Lando Norris claimed a famous maiden pole position for McLaren at the Russian Grand Prix as Lewis Hamilton paid the price for a crash in the pits.
Norris went quickest in rain-soaked Sochi, edging out Carlos Sainz by six hundredths of a second, while Williams' George Russell was third.
With championship leader Max Verstappen ordered to start from the back of the grid after his Red Bull had a new engine installed, there was a chance for Hamilton to put pressure on his main rival.
However, the seven-time champion collided with the pit-lane wall and was forced to change his front wing before spinning on his final lap.
Hamilton will start from fourth on the grid, ahead of Daniel Ricciardo, while Fernando Alonso, Valtteri Bottas and Lance Stroll make up the rest of the front eight.
"Oh, boy. I don't know what to say," said a breathless Norris. "You never think you're going to get a pole until you get it, and now I've managed to do it.
"It was tricky. The lap before, I was, like, two seconds down and I wasn't confident we were going to improve on the previous lap, but I kept the tyres warm and risked quite a bit, I will admit, but it paid off. I'm a happy boy.
"I'm not really looking forward to [the race]! I'm not looking forward to being the first down to turn one. But you never know – it's going to set us up well. I'm just really happy."
After third practice was cancelled due to the torrential rain, Hamilton had set the fastest time heading into Q3, ahead of team-mate Bottas and Alonso.
Hamilton looked heavy favourite after clocking a new fastest time until his mishap as he came into the pits to change to soft tyres.
With time enough only for one more lap, the Briton spun and nudged the wall, leaving him unable to deny Norris a famous day in Russia as McLaren celebrated a first pole since 2012.
"Twice in the wall... that's very rare for me," said Hamilton. "I'm really sorry to all the team because that's not what you expect from a champion."
1. Lando Norris (McLaren) 1:41:993
2. Carlos Sainz (Ferrari) +0.517
3. George Russell (Williams) +0.990
4. Lewis Hamilton (Mercedes) +2.057
5. Daniel Ricciardo (McLaren) +2.163
6. Fernando Alonso (Alpine) +2.211
7. Valtteri Bottas (Mercedes) +2.717
8. Lance Stroll (Aston Martin) +2.963
9. Sergio Perez (Red Bull) +3.344
10. Esteban Ocon (Alpine) +3.872