BAKU • Lewis Hamilton came back from a trying weekend to steal pole for the Azerbaijan Grand Prix.
The British driver had been struggling with set-up and tyres through practice but was able to extract everything from his car and looked almost untouchable in qualifying.
His Mercedes team-mate Valtteri Bottas was second, with Ferrari's Kimi Raikkonen third.
Hamilton took pole in a nail-biting finale prompted by a red flag late in the final session and a concerted push from Bottas.
His Ferrari title rival Sebastian Vettel could not quite hook up a quick run and finished in fourth.
"One of the most exciting laps I have had all year," said Hamilton. "There was a lot of pressure because we have been struggling to get temperature into these tyres so it was all or nothing. I am ecstatic. I am so happy."
Hamilton trails Vettel by 12 points in the drivers' championship, with each driver having taken three wins this season and the British driver is now in the best position to try and further close the gap.
AZERBAIJAN GP GRID
1 Lewis Hamilton (Gbr) Mercedes
2 Valtteri Bottas (Fin) Mercedes
3 Kimi Raikkonen (Fin) Ferrari
4Sebastian Vettel (Ger) Ferrari
5 Max Verstappen (Ned) Red Bull
6 Sergio Perez (Mex) Force India
7 Esteban Ocon (Fra) Force India
8 Lance Stroll (Can) Williams
9 Felipe Massa (Bra) Williams
10 Daniel Ricciardo (Aus) Red Bull
16 Fernando Alonso (Spain)
Mercedes lead Ferrari by a slender eight points in the constructors' championship.
Hamilton was quickest in Q1, 0.6sec ahead of the second-placed Red Bull of Max Verstappen, who qualified fifth, and just as he had improved all weekend went one better in Q2.
He knocked a further 0.7sec off his time in the second session, which was 0.3sec clear of Bottas in second place.
During his first hot run in Q3, he lost time in the final sector going wide at Turn 16 and he was two-tenths down on his team-mate who put in a clean lap of 1min 41.274 seconds.
Hamilton was then on a quicker run, fastest in the first sector, when the session was red-flagged after the Red Bull of Daniel Ricciardo came to a halt on track, having hit the wall exiting Turn Six, putting him into 10th on the grid.
It left barely enough time to complete two laps - the bare minimum for the Mercedes to bring the tyres up to temperature for a flying lap but, while Bottas pushed hard, he was followed by another brilliant run by Hamilton, who nailed the second and third sectors to take pole.
His final run of 1:40.593 was ultimately 0.5sec clear of his team-mate.
This is the fifth pole of the season for Hamilton and the 66th of his career, one better than his hero Ayrton Senna's tally of 65 and he is just two short of Michael Schumacher's total of 68, the most by any driver.
"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 (today), but it's the best place to start."
F1 AZERBAIJAN GP
Singtel TV Ch114 & StarHub Ch208, 8pm
•Singapore Grand Prix tickets are available at www.singaporegp.sg