Mercedes turned the form book on its head as Valtteri Bottas led Lewis Hamilton to a one-two in qualifying at the Mexico City Grand Prix.
Championship leader Max Verstappen, who had dominated the weekend until qualifying, could manage only third.
Verstappen leads Hamilton by 12 points heading into the race, the first of five in six weeks to decide the title.
But a Mercedes front-row lock-out gives Hamilton a great chance to claw back some ground in the championship race.
The world champions’ performance was a huge surprise even to themselves, as Mercedes came into the weekend expecting to be lagging behind Red Bull on pace.
Instead, after Red Bull had looked so strong throughout the practice sessions, Mercedes pulled it out from the start of the second part of qualifying.
Hamilton said: “We have been working so hard. We didn’t think we had the pace this weekend so to lock out the front row is pretty special.
“I really have no idea [what happened]. They were 0.6secs ahead at some stage and then 0.4secs ahead, but whatever happened all of a sudden in qualifying we had better pace. I’m just as shocked as everyone.”
A gripping session
Once the first session of qualifying was properly under way, after a near half-hour delay caused by an early crash for Aston Martin’s Lance Stroll, events started as expected, with Verstappen well over half a second clear of the Mercedes drivers.
But into the second part of qualifying, the picture began to change.
Now on the medium tyres, because of teams’ preference to start the race on them over the softs, the Mercedes was suddenly competitive, Hamilton just 0.016secs off Verstappen.
Few would have been expecting the Mercedes to stay there when the teams reverted to the soft tyres for the final top 10 shoot-out, but that’s exactly what happened.
Bottas produced a blistering initial lap to be 0.35secs clear of Verstappen, with Hamilton in between them.
Verstappen complained of low grip at the rear but was still hopeful of improving enough to fight for pole on his second and final lap, but his chances were over when Alpha Tauri’s Yuki Tsunoda went off in front of Verstappen’s team-mate Sergio Perez.
Verstappen was running behind them and backed off expecting yellow flag that never came, and his chances of a pole that had looked a given for most of the weekend were gone.
Bottas said: “It was an awesome lap, especially my lap first lap in Q3. Honestly, it was one of my best laps and it’s a good feeling.”
The Finn admitted he had “definitely surprised myself – we seemed to be off Red Bull but we managed to perfect the set-up”.
Hamilton congratulated Bottas on an “awesome job” and the seven-time champion said he could not have matched his team-mate’s time.
“We have generally been behind by half a second,” Hamilton said. “We have been working away at the car but they have generally got higher downforce, so we have struggled in certain parts so it’s a real surprise to see us on the front row.”
Verstappen said: “We seemed to struggle to get the tyres right. The first run was terrible. I knew there was something more available if we could get it right. There was definitely a chance to beat Valtteri’s time.
“It’s not a great place to finish after being so competitive all weekend, but it is a long run to Turn One, so let’s see.
“We were just really slow and had terrible grip in Q3. On the last lap we recovered it a bit but it’s still not to how we would’ve liked and not how the car has been behaving in all the practice sessions.
“Tomorrow we race on different tyres and I expect the balance to be good again. We just had a terrible qualifying.”
A plethora of penalties
There are effectively three Red Bulls directly behind the Mercedes, with Verstappen’s team-mate Sergio Perez in fourth and the Alpha Tauri of Pierre Gasly an impressive fifth.
Ferrari’s Carlos Sainz was sixth, ahead of McLaren’s Daniel Ricciardo, the second Ferrari of Charles Leclerc and Alpha Tauri’s Yuki Tsunoda.
Lando Norris progressed into the final part of qualifying for the sole purpose of giving team-mate Ricciardo a slipstream, as the Briton is one of four drivers demoted to the back of the grid with penalties for exceeding engine allowances. The others are Tsunoda, Stroll and Alpine’s Esteban Ocon, who qualified 15th.
Williams’ George Russell will start directly ahead of them in 16th, despite qualifying 13th, because he has a penalty for changing his gearbox.