Baku: Lewis Hamilton snatched pole position for Sunday's Azerbaijan Grand Prix after eclipsing Mercedes team-mate Valtteri Bottas on his final qualifying lap on Saturday.
The three-time world champion starts ahead of Bottas with Ferrari duo Kimi Raikkonen and Sebastian Vettel, the championship leader, occupying the second row of the grid.
Hamilton claimed the 66th pole of his career, pulling clear of Brazilian great Ayrton Senna's mark and leaving the Briton just two shy of Michael Schumacher's record of 68.
The 32-year-old bounced back from a frustrating practice outing on Friday to clinch his fifth pole in eight races this season as Mercedes locked out the front row.
Hamilton's quickest lap of 1min 40.593sec came in the final seconds of the session following a red-flagged stoppage which turned the finale into a 3min 30sec showdown.
"I am so pumped - that's how qualifying should be," said an ecstatic Hamilton, who was more than a second off the pace on Friday. "It is going to be a long hard race, but it's the best place to start."
Bottas, who had been fastest in Q3 until Hamilton's stunning final lap, admitted he was disappointed.
"The lap, in the end, wasn't quite perfect, I was struggling the front left temperature and Lewis then did his lap! It's disappointing, but second place is not bad."
Hamilton is 12 points behind Vettel in the championship after seven races. Max Verstappen was fifth for Red Bull ahead of the two Force Indias of Sergio Perez and Esteban Ocon, Canadian teenager Lance Stroll who was eighth ahead of his Williams team-mate Felipe Massa and Australian Daniel Ricciardo, who crashed his Red Bull to engage the red flag and create the final drama.