McLaren's Lando Norris took pole position in a thrilling rain-affected qualifying at the Russian Grand Prix.
Mercedes driver Lewis Hamilton was only fourth after crashing in the pit lane mid-way through the final sessions and then spinning on his final lap, as drivers risked slick tyres in the closing stages.
Ferrari's Carlos Sainz and Williams driver George Russell took advantage of Hamilton's error to vault into second and third places.
McLaren's Daniel Ricciardo took fifth ahead of Alpine's Fernando Alonso.
It was a dramatic end to a session that at one stage earlier in the day looked as if it might not even take place, so heavy was the rain that started overnight and continued into the morning at the Black Sea resort of Sochi.
And it was a case of missed opportunity for Mercedes, with Hamilton's title rival Max Verstappen starting from the back of the grid as a result of a penalty for using too many engines.
- Hamilton will 'not bail out' of on-track battles any more
- Verstappen to start at back of grid
- Russian Grand Prix coverage details
- Full qualifying results
What happened to Hamilton?
Hamilton will be looking to take advantage of Verstappen's lowly starting position to reclaim ground in the championship, in which he trails the Dutchman by five points.
But he hampered his own chances when he had a flick of oversteer coming into the pit lane to change to untreaded slick tyres with five minutes of the final session remaining.
The car touched the wall on the left, breaking his front wing, and causing chaos in the Mercedes pit.
As the mechanics struggled to change Hamilton's wing, with his newly fitted slick tyres losing temperature in the cool, damp conditions, team-mate Valtteri Bottas was queued behind him.
Eventually, Mercedes wheeled Hamilton out of the way to service Bottas first, before repairing the seven-time champion's car.
The delay meant Hamilton's tyres had lost temperature, and once out on the track he complained of a lack of grip and lost control at Turn 16, failing to improve on his time set on intermediate tyres earlier in the session.
Norris takes maiden pole
Norris's pole was redemption for the Briton after his crash in qualifying in the wet in Belgium last month when he looked in contention for top spot.
Already one of the most impressive drivers of the year in the McLaren, Norris produced a final lap 0.517 seconds quicker than Sainz to take a hugely impressive maiden pole.
Norris said: "It feels amazing. I don't know what to say. Quite a manic session. You never think you're going to get a pole until you get it. I'm extremely happy."
Sainz rued being one of the first to complete his lap on a track that was getting drier by the second.
"It was a very tricky qualifying right from the beginning, but right after Q2 I could see there was a chance the slick was going coming into play. We did a good job getting the slicks up to temperature. Unfortunately I was one of the first across the line and it I wasn't able to fully exploit the conditions."
Russell's stellar third place for Williams follows his stunning performance in Belgium, when he was second behind Red Bull's Max Verstappen, also in the wet.
Alonso was also impressive - fourth fastest in the wetter second part of qualifying, the Alpine could not quite match the faster cars in front as the track dried, but the veteran Spaniard was comfortably clear of team-mate Esteban Ocon throughout.
Bottas struggled to seventh, ahead of Aston Martin's Lance Stroll, Red Bull's Sergio Perez and Ocon.
Verstappen is joined at the back of the grid by Ferrari's Charles Leclerc and Williams' Nicholas Latifi, who also have engine penalties.
All three did not try to optimise their performance in qualifying as a result.
- Float: Will it be sink or swim for this poolside romance? Stream now on BBC iPlayer
- A Killing in Tiger Bay: One of Britain's most notorious miscarriages of justice