Mercedes' Lewis Hamilton put his tricky start to the season to one side to narrowly beat Ferrari's Sebastian Vettel to Spanish Grand Prix pole. Vettel, of Germany, was just 0.051 seconds behind his British rival.
Hamilton registered a fastest lap of 1 minute 19.149 seconds on the Circuit de Catalyuna in Barcelona for his third pole of the season and the 64th of his Formula 1 career.
Vettel's last lap was his quickest but it wasn't quite enough to displace the three-time champion. Hamilton's teammate Valtteri Bottas came in third, while Kimi Raikonnen, in the second Ferrari rounded out the top four.
The Red Bulls of Max Verstappen and Daniel Ricciardo were fifth and sixth, with McLaren's Fernando Alonso in seventh for his home grand prix.
Historically, it's been important to start from the front in Barcelona - 13 of the last 16 Spanish Grands Prix have been won from pole.
"I'm super proud that we can get back up there," Hamilton said. "My last lap was so-so but I could see the fans cheering and all the flags."
Vettel goes into the race with 86 points in the standings after winning two of the previous four races. Hamilton is on 73, Bottas on 63 and Raikkonen on 49.