SAKHIR, Bahrain (AP) — Mercedes driver Nico Rosberg looks to have salvaged what seemed like a lost season by taking pole position on Saturday at a Bahrain Grand Prix that is being held amid widespread anti-government protests.

The second pole of Rosberg's career finally gave him something to celebrate this season. The German has retired early in two of the three grand prix, and in the other he was left seething when he was forced by the team to finish behind teammate Lewis Hamilton in fourth place in Malaysia.

"Yes! Come on guys, that's how it's done," Rosberg screamed into his radio.

He finished 0.25 seconds in front of series leader Sebastian Vettel, and 0.33 ahead of third-placed Fernando Alonso, who won last week's Chinese GP.

"As a team, we worked really hard during the night to improve the car because yesterday we were really struggling," said Rosberg, who had his first F1 start in Bahrain but never started in the top four on the desert circuit. "I'm really, really happy. That's a fantastic result. That's great for tomorrow."

Vettel, who has struggled this season to adjust to the softer tires compounds, said he was "not disappointed" to be starting second. The Red Bull star has only one pole so far.

"When I got told the gap to P1, to Nico, it was clear that even with the perfect lap he was unbeatable today," Vettel said. "Nevertheless, (I'm) very happy."

Alonso was fastest in the third practice and had a chance to eclipse Rosberg but committed errors on his final lap. The Spaniard later said his Ferrari team realized they were about half-a-tenth or one-tenth slower than their fastest lap after the miscues so "we decided to come in just to save one lap on this tires."

"Very, very happy with third place," Alonso said. "Normally, in qualifying, we're struggling a lot but today the car was very competitive and this puts us in a strong position to start tomorrow's race with the leaders and fight for the podium with a little bit more margin."

Hamilton, was fourth but will start ninth following a five-grid penalty for a gear box change. Because of that, Mark Webber of Red Bull, who was fifth but was given a three-grid penalty last week in China, will start seventh. This will be Webber's 200th grand prix.

The penalty is a further headache for Hamilton. He hasn't gone well in practice, finishing no higher than 10th in the first two sessions and then damaging his rear left tire at the end of the third.

The Briton has had a surprisingly successful start in his first season at Mercedes. He has finished on the podium in the past two races and took pole at the Chinese GP.

The dusty and hot track was not kind to Lotus drivers, with Kimi Raikkonen only ninth fastest and his teammate Romain Grosjean continuing his forgettable season by managing 11th. Raikkonen moved up to eight on the grid with the Hamilton penalty.

McLaren also had its problems, fulfilling a prediction made by team principal Martin Whitmarsh that its car would not have a smooth run in Bahrain. Jenson Button was 10th fastest while teammate Sergio Perez was down in 12th.

"It's been a very difficult weekend so far, but 10th is a strong result for us," Button said.

"The team is used to fighting at the front, so it's the little things - like getting through into Q3 - that can make a positive difference. I'll race as quickly as I can, but I don't want people to expect too much from us."

Force India also benefited from the penalties, with Paul di Resta starting fifth and Adrian Sutil sixth.

"We're in a great position for tomorrow; the car is strong and our long-run performance yesterday gives us every reason to be hopeful of challenging for some good points," di Resta said.

A day after the daily anti-government protests turned violent and involved riot police, clashes were reported in the old quarter of the capital Manama, and in a village close to the circuit where protesters set fires.

Crown Prince Salman bin Hamad Al Khalifa, touring the paddock, said he was pleased that the protests so far have been mostly peaceful. Asked about the empty stands, he said most fans were spending time in the circuit village. He said about 15,000 came to the 45,000-seat circuit on Friday and that he expect bigger crowds on Saturday.

"Keeping Bahrain connected to the international community is a very important thing for us," the crown prince said. "It stops people from looking inwards and allows us to look outwards. It gives people connections to the outside world they otherwise wouldn't have."

The crown prince also dismissed allegations by rights groups that the race was used by the Sunni-led government to gloss over problems with its majority Shiite population. The race was cancelled in 2011 due to the Arab Spring-inspired uprising and was overshadowed last year by massive protests outside the circuit.

"We've never used this race to say that everything is fine," the crown prince said. "We recognize there are issues in the country but they are to be solved through a political process which is well underway. I can name at least four other grand prix venues which have political problems but (they) don't seem to attract that kind of attention."