By Alan Baldwin
MANAMA (Reuters) - Nico Rosberg planted his Mercedes on pole position for the second year running in Bahrain on Saturday after a last-lap error cost team mate Lewis Hamilton his chance of a qualifying hat-trick.
Rosberg, the Formula One championship leader, had been in Hamilton's shadow throughout practice but struck when it mattered in the floodlit evening session to secure his first pole since Monaco last May.
His lap of one minute 33.185 seconds was 0.279 quicker than the Briton's best.
Hamilton, who won in Malaysia last weekend and was chasing his third successive pole, had to settle for second.
"I have good memories of this track, winning the GP2 championship and starting my first race in F1. I enjoy coming here and again today, it's suited me," said Rosberg, who won the season-opener in Australia.
"It's a different challenge awaiting us for the race. Tire degradation may be the main problem and difficulty but I'm confident," added the German of his fifth career pole.
"I had some good runs yesterday on high fuel so I'm confident that I can stay ahead in tomorrow's race."
Hamilton had been quickest in all three practice sessions, with Rosberg second, but was trailing his team mate as he prepared for his final lap.
He overcooked it, running wide, and fixing the front row there and then.
"You can't always get it right and congratulations to Nico," said the 2008 champion. "He did a great job this weekend, he's been improving and picking up his pace. He had a really good lap at the end there.
"I made a mistake on my last lap, locked up and went straight on but generally I'm happy. I'm really proud of the team, for us to continue to keep moving forward and progressing as we are."
Hamilton could yet come out on top on Sunday, with last year's winner Sebastian Vettel starting in second place in 2013 for Red Bull.
Vettel will have a job to repeat that feat from 10th at a circuit that has yet to see a winner from outside the front two rows on the grid.
His new Australian team mate Daniel Ricciardo qualified third fastest but carries a 10-place grid penalty imposed in Malaysia for an unsafe pitstop release that drops him back behind Vettel.
"I'm really pleased with the performance. At the moment it's the best anyone else can do besides the two guys alongside me," said Ricciardo in a post-qualifying news conference.
Finland's Valtteri Bottas will move up to take the third place slot for Mercedes-powered Williams.
Mexican Sergio Perez, who did not start in Malaysia due to a software glitch, will join him on the second row in his Mercedes-powered Force India with a good chance of a podium finish.
Vettel failed to make the final phase of qualifying for the second time in three races.
"They (Mercedes) are out of reach. This track suits them here," said the German, who spun off in final practice and had a problem with the gear shifts.
"We felt already in testing that it's a difficult track for us. We are down on power. Around here you need some power. That's how it is. Nevertheless tomorrow we have a good chance to put the car in a fairly good place in the points."
Ferrari's Kimi Raikkonen qualified sixth, but moves up to fifth, with McLaren's Jenson Button alongside and Brazilian Felipe Massa's Williams sharing the fourth row with McLaren's Danish rookie Kevin Magnussen.
Ferrari's Fernando Alonso qualified 10th, but lines up ninth and on the clean side of the track, saying he had suffered a drop in power in the final phase.
Sunday's race will be the 10th edition of the Bahrain Grand Prix, with a backdrop of civil unrest clouding the race since 2011, and the first in its new day-to-night format.
(Editing by Ed Osmond)