BARCELONA, Spain (AP) Lewis Hamilton picked qualifying to edge Mercedes teammate Nico Rosberg for the first time this week and earn pole position for the Spanish Grand Prix on Saturday.
Hamilton qualified nearly three-tenths of a second faster than Rosberg at the Barcelona track to win his third pole of the season and move into position to snap a seven-race winless streak.
''Hopefully everything comes together,'' Hamilton said. ''We are in the best position to start from. Tomorrow could be a good day.''
Red Bull surprised with Daniel Ricciardo finishing third, just ahead of new teammate Max Verstappen, who was controversially promoted at the expense of Daniil Kvyat, who was sent back to Toro Rosso. He's 13th on the grid.
Ferrari was showing good pace and appeared in position to close the gap to Mercedes in qualifying, but Kimi Raikkonen will start only fifth and teammate Sebastian Vettel sixth.
''Something went wrong for both drivers,'' Ferrari team principal Maurizio Arrivabene said. ''We have to check. We were far better.''
Vettel led the way in the first practice on Friday and was only one tenth of a second slower than Rosberg in the final practice before qualifying.
It was the 52nd career pole for Hamilton, who is looking to turn his season around after a dismal start plagued by mechanical failures and bad luck. He wasn't in position to fight for the pole in the last two races because of problems with his car.
''It's three for three for me,'' said Hamilton, who already trails his teammate by 43 points after four races. ''I'm very happy. The car was great. Yesterday was a bit of a difficult day, so to be able to start on the right foot today is a real blessing.''
Rosberg, who won from the pole in Spain last year, started from the front in the previous two races. On Sunday, he will be trying to win his eighth straight race, going back to last season. Only two drivers won five in a row to start a season, Nigel Mansell with Williams in 1992 and Michael Schumacher with Ferrari in 2004.
''For sure I'm disappointed to be second,'' Rosberg said. ''Fortunately, it's the race that counts, so there are still a couple of opportunities tomorrow. The start, for example, and strategy wise it's not going to be an easy race, so I'll try to take my chances.''
Red Bull was far behind Ferrari and Mercedes in practice but both cars were near the front throughout qualifying. The 18-year-old Verstappen at one point was second on the timesheets.
''To be ahead of both the Ferraris, an amazing performance from both our drivers. I don't know if Daniel was sandbagging or not, but his last lap was mighty. And take nothing away from Max, what a first qualifying session,'' Red Bull team principal Christian Horner said.
Home-crowd favorite Fernando Alonso put McLaren into the final qualifying session for the first time since Abu Dhabi in 2014, and will start 10th. McLaren hadn't started so well since rekindling its partnership with Honda. Teammate Jenson Button was 12th fastest.
Williams' Valtteri Bottas will start seventh, but teammate Felipe Massa had couldn't make it past the first qualifying session. The Brazilian, who won in Spain in 2007 and is sixth in the drivers' championship, will start only 18th.
''I had traffic on the first lap then we stopped to change the tires and didn't have time to go out again,'' he said. ''It's really a shame. We needed a bit more of a margin, it wasn't done correctly.''
The pole winner has won 19 of the last 25 races at the Barcelona-Catalunya track.
Tales Azzoni on Twitter: http://twitter.com/tazzoni. His work can be found at http://bigstory.ap.org/content/tales-azzoni