Lewis Hamilton snatched pole position at the Singapore Grand Prix with a sensational final lap to beat Mercedes team-mate Nico Rosberg.
The Brit produced a stunning time of one minute 45.681 seconds to narrowly steal in ahead of Rosberg by just 0.007secs, claiming his sixth pole of the season.
German Rosberg (1:45.688) had only held the provisional pole for a few seconds himself, having eclipsed Red Bull's Daniel Ricciardo and his time of 1min 45.854.
However, his efforts were in vain as Hamilton put a first-corner mistake behind him to finish top of the timesheets.
In a tense final session ahead of Sunday's race, it was Williams' Felipe Massa who led for the majority, only to see his advantage disappear late on.
First, he saw Ricciardo go quickest as the chequered flag came out but with Rosberg and Hamilton having started their hot laps, both produced late drama.
Rosberg's time looked to have given him the edge, especially after Hamilton had locked up heading into the first corner.
But the championship leader was nudged into second place as Hamilton responded in superb style, giving Mercedes a front-row lockout.
Defending world champion Sebastian Vettel (1:45.902) claimed fourth in the other Red Bull, while Fernando Alonso (1:45.907) finished fifth fastest in his Ferrari.
Massa (1:46.000) had to settle for sixth with Kimi Raikkonen (1:46.170), Valtteri Bottas (1:46.187), Kevin Magnussen (1:46.250) and Daniil Kvyat (1:46.926) completing the top 10.
Ferrari had looked strong in the earlier sessions, with Raikkonen fastest in first qualifying and Alonso third in the second outing.
Rosberg's evening started with a mistake on his first timed lap as he locked up and was forced to go straight on at a corner, but he recovered and in the second session the German was fastest, with a time nearly half a second quicker than anyone else.
However, he was unable to replicate that when it mattered and Hamilton grabbed pole for a race he last won in 2009.