BARCELONA, Spain (AP) — Lewis Hamilton ended Sebastian Vettel's dominant run in Formula One qualifying by setting a track record and wining pole position for the Spanish Grand Prix on Saturday.
Hamilton had a lap of 1 minute, 16.173 seconds at the Circuit de Barcelona-Catalunya, only four hundredths of a second ahead of Mercedes teammate Valtteri Bottas.
Vettel, who won three straight poles, will start third, followed by Ferrari teammate Kimi Raikkonen.
Red Bull drivers Max Verstappen and Daniel Ricciardo were fifth and sixth, respectively.
"I needed this pole. I've not had pole for a while," Hamilton said. "It was very close but I'm very happy. It's important for me to get back into a good position in qualifying, it's usually a strength of mine."
It was a record-extending 74th pole for Hamilton, and the first since the season-opener in Australia.
"It took everything we've got to take pole," the defending F1 champion said. "Ferrari were sandbagging until this afternoon and Valtteri has been driving exceptionally well. It's fantastic for the team to get the front row. This is a good way to start the weekend."
It was the first front-row lock up for Mercedes this season, and 51st all-time.
"I got a decent lap," said Bottas, who was leading in Azerbaijan when a tire blew near the end of the race. "It's a shame it's only four hundredths but for us as a team, perfect result today."
Vettel said he was "not entirely happy" but already expected Mercedes to be strong. He foresaw an "interesting race" on Sunday.
"It will be close," he said. "Anything can happen really, just like the last couple of races."
A good starting position is crucial in Spain as there are not many overtaking opportunities. The winner has come from the front row in 24 of the 27 races in Barcelona.
Hamilton will be trying to win his second race in a row and add to his four-point lead over Vettel in the drivers' standings. Vettel won in Australia and Bahrain, while Ricciardo was first in China and Hamilton triumphed in Azerbaijan.
Mercedes was fastest in all three practices in Barcelona, with Hamilton and Bottas leading the timesheets.
Most teams brought significant updates to Spain, which marks the beginning of the European season in F1.
Ricciardo said he was frustrated with the gap to the front. He and Verstappen were six tenths off the pole time.
"I chipped away at my lap time by a few hundredths but it wasn't enough," Ricciardo said. "Then they put in some belters at the end. It is a little bit disheartening as I don't really know what I could have done more."
Kevin Magnussen will start seventh with Haas. Teammate Romain Grosjean is 10th on the grid.
"It was a really good qualifying. P7 for us is really pole position," Magnussen said. "It's the best you can hope for if you're not in a Ferrari, Mercedes or Red Bull."
Both Spanish drivers made it to the final qualifying session, with two-time champion Fernando Alonso eighth with McLaren and Carlos Sainz ninth with Renault.
"Everything we bring to the track is delivering the expectations and the lap times we were expecting from them," Alonso said. "So that's a positive thing."
Raikkonen was on a new engine after a problem with the one he used on Friday.
Nico Hulkenberg of Renault failed to make it past the first qualifying session because of an apparent fuel pressure issue.
There was some disquiet with the rear-view mirrors Ferrari mounted on the halos. The team will likely have to change it for the next race, but no penalties were expected in Spain.
Brendon Hartley of Toro Rosso did not make it to qualifying because the team was not able to fix his car after a crash in the final minutes of Saturday's practice. He clipped the grass on the entry of a turn and spun into the tire barrier, significantly damaging the car. The rear end fell apart as the car was being hoisted by a crane.
Lance Stroll continued to struggle with Williams, going off track in the final minutes of qualifying. He also went into the gravel in practice earlier on Saturday and on Friday.
Race organizers said additional security was implemented after several cars were broken into at a closed parking lot for the media at the track.
More AP auto racing: https://racing.ap.org
Tales Azzoni on Twitter: http://twitter.com/tazzoni