Charles Leclerc made it back-to-back pole positions as Ferrari locked out the front row for the Mexico City Grand Prix.
In an incredible twist, the Scuderia went fastest after the first runs in Q3 and not even Max Verstappen had an answer as the Dutchman settled for third.
Carlos Sainz will start second with Daniel Ricciardo a star of qualifying in fourth for AlphaTauri, beating Sergio Perez in the second Red Bull.
Q1
Verstappen led the way in Q1 with a variety of strategies behind as some tried the medium tyres as the pace difference was much smaller than at most tracks.
Ricciardo enjoyed a nice tow from teammate Yuki Tsunoda, who is starting at the back of the grid due to power unit penalties, to sit well up the leaderboard for AlphaTauri.
McLaren bailed early on their medium tyre strategy with Oscar Piastri moving to P2 on softs but Lando Norris made a mistake on his only flying lap and ended up 19th.
Norris could have had a second lap but a spin for Fernando Alonso at Turn 3 triggered a yellow flag that prevented him from improving.
Esteban Ocon was frustrated to miss the cut in 16th, ahead of Kevin Magnussen in 17th and Lance Stroll in 18th.
Norris was 19th and Logan Sargeant failed to set a time in 20th after having both laps deleted for track limits.
Elsewhere, Verstappen and George Russell face investigations for impeding after stopping at the end of the pit lane, while Hamilton could also be in trouble for failing to slow under yellow flags.
Q2
A late lap from Hamilton put him P1, just ahead of Verstappen, who only completed one run.
Ricciardo also continued to shine thanks to a slipstream from Tsunoda and the fastest Sector 3 in his AlphaTauri.
After showing strong pace in practice, Alex Albon was struggling for grip in his Williams, while the Mercedes’ and Ferraris were on the bubble in the lower half of the top 10.
Albon looked to have gotten through in P9 but had his lap time deleted for track limits, promoting Zhou Guanyu back into the top 10.
Pierre Gasly was 11th followed by Nico Hulkenberg and Alonso in 13th. Albon slipped to 14th as Tsunoda didn’t set a time, leaving Ricciardo tow-less for Q3.
Q3
The first runs proved crucial in Q3 as Ferrari came out of nowhere to lock out the front row with Leclerc fractionally ahead of teammate Sainz.
Verstappen was third as less than a tenth covered the top three with Ricciardo an incredible fourth, ahead of Sergio Perez in the second Red Bull.
Hamilton was sixth followed by Piastri and Russell eighth in the second Mercedes. Valtteri Bottas pipped teammate Zhou by just 0.018s as the Alfa Romeos completed the top 10.
The result remains provisional, however, as Verstappen and the two Mercedes drivers face post-session investigations from incidents in Q1.