Mercedes driver Lewis Hamilton produced one of the best laps of his career to take a surprise pole position for the Singapore Grand Prix.
Hamilton's first lap in final qualifying, described by his race engineer as "epic", was enough despite failing to improve on his second run.
"That lap felt like magic," the world champion said. "I don't know where it came from. I am overwhelmed."
His title rival Sebastian Vettel was third behind Red Bull's Max Verstappen.
Hamilton excels; Vettel struggles
Hamilton said his lap was "one of the best I can remember".
It came out of the blue - he was 1.3secs faster than his own previous best lap of the weekend, and the scale of his achievement became clear as his rivals crossed the line.
Team-mate Valtteri Bottas was 0.7secs behind, Vettel 0.6secs off and Verstappen, surprisingly pipping the Ferrari, 0.3secs.
Vettel, who is 30 points behind Hamilton in the championship and came into the weekend as favourite, was downcast.
"We wanted to get pole and we didn't," the German said. "It was a bit of a messy qualifying session, there was too much time missing."
Hamilton could not improve on his second run - and aborted his final lap before it was even halfway through.
But although Vettel set a faster first sector than anyone on his final attempt, neither he nor Verstappen could improve and the positions were set.
Bottas took fourth, slightly improving on his final lap to end the session 0.687secs slower than Hamilton, with the second Ferrari of Kimi Raikkonen fifth and Red Bull's Daniel Ricciardo sixth.
- Qualifying results
- Singapore Grand Prix radio and coverage details
- Predict your top three in Singapore
Mercedes overcome Singapore slump
The result was a huge surprise. Mercedes have traditionally struggled at Singapore, and Ferrari came into the weekend as strong favourites.
Mercedes' form on Friday suggested they were in better shape this year, but no-one - not even the team - expected Hamilton to do what he did.
There were nervy moments early in qualifying, when Mercedes chose to use only the ultra-soft tyre - the middle of the three compounds - in the first session, and Hamilton was only two places clear of being knocked out as a result.
Mercedes were competitive in the second session, Hamilton ending it fourth, just under 0.2secs off pace-setter Raikkonen, but there were no indications of the time that was to come.
When Hamilton reeled off his lap of one minute 36.015, engineer Peter Bonnington came on radio and said: "That was a pretty epic lap."
More questions for Ferrari
Ferrari had their own problems in qualifying. They tried to use the ultra-soft tyre in the second session but had to abort the plan when it emerged they would not be quick enough to make it into the top 10.
And in the final session, Vettel was a bit short with his team after the first run, saying they had not put him out in a good place on track for traffic, which had affected his preparation.
"Qualifying wasn't as smooth as it should have been," he said. "Difficult to get a rhythm, difficult to get a feel for the car. The gap is quite big but I am not worried about that. I don't think we got the most out of our car."
Vettel acknowledged Hamilton's lap was strong but said he did not feel it was unbeatable.
Verstappen said he felt he had done the best qualifying session of his career and he could have been even faster had it not been for drivability problems with his engine which have been afflicting him for most of the weekend.
But he doubted he could have beaten Hamilton's time.
The final places in the top 10 were taken by Force India's Sergio Perez, Haas' Romain Grosjean, the second Force India of Esteban Ocon and Renault's Nico Hulkenberg.
McLaren's Fernando Alonso was just pipped by the German and will start 11th, but was pleased with that result because it gives him free tyre choice for the start of the race.
- The biggest enemy is me - Vettel
- Singapore Grand Prix: Still in F1 10 years after 'crashgate'
- Formula 1 reveals 2021 car concepts
'Maximum on every corner'
This was the 79th pole of Hamilton's career.
"I was a bit nervous going into qualifying because I didn't think we had the pace," he said. "We were half a second behind these guys. Then the real challenge on the ultra.
"We got into that last session and it was about pulling all the bits from free practice and trying to put it into a perfect puzzle. 99.9% of the time it doesn't go right, and that lap I didn't have any wheelspin, any snaps, it was pretty much maximum on every corner.
"I didn't think I could do any more. The second lap I tried to go that little bit more, braking half a metre later but the car wasn't going to have it.
"I was nervous at the end but I am so grateful."
Who will win in Singapore?
Choose your top three drivers from the list below