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 time of 1 minute, 16.173 seconds at the Circuit de Barcelona-Catalunya, and 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 was also the first front-row lock up for Mercedes this season.
"Not entirely happy, but we expected Mercedes to be very strong," Vettel said. "Tomorrow, it should be an interesting race."
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, with Hamilton and Bottas leading the timesheets.
Most teams brought significant updates to Barcelona, which marks the beginning of the European season in F1.
Kevin Magnussen will start seventh with Haas. Teammate Romain Grosjean is 10th on the grid.
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.
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 FIA was looking into a possible breach of regulations.
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.