Max Verstappen put himself on pole position for a third successive Mexican Grand Prix win on Saturday in a qualifying session that ended with Mercedes's title contender Valtteri Bottas crashing heavily.
The Dutchman was summoned to stewards afterwards, however, for failing to slow for yellow warning flags following the crash.
Ferrari's Charles Leclerc joined Verstappen on a front row of 22-year-olds with four-times world champion team mate Sebastian Vettel third.
Verstappen will be surrounded by Ferraris on the grid on Sunday
Image credit: Getty Images
Hamilton, who starts fourth, can wrap up the championship with three races to spare on Sunday -- providing he finishes on the podium at the Autodromo Hermanos Rodriguez.
Bottas was passed fit after a trip to the medical centre, but Mercedes faced a busy evening repairing extensive damage to his car.
"It will be a bit different starting first instead of second, so I'll give it all and we have a good race car anyway," said Verstappen, winner in 2017 and 2018 from second on the grid.
Since the high-altitude race returned to the calendar in 2015, every winner has started on the front row.
Verstappen's second career pole position ended a run of five in a row for Ferrari, who came into the weekend as favourites and locked out the front row in the previous race in Japan.
Champions Mercedes have now gone six races without a pole, with Verstappen taking his first in Hungary before the August break.
"In that last sector, it all went to pot. I'm generally happy with today, it's hard to keep up with the others," said Hamilton.
"We knew it would be difficult this weekend but I gave it everything; it wasn't enough for pole and I got enough out of the car and it puts us in a good enough fighting position for tomorrow."
'I'm only human' - Hamilton responds to social media criticism ahead of Mexican GP
Bottas, the only driver with a mathematical chance of denying Hamilton the title, qualified sixth but with questions about possible grid penalties.
He said the team was 'pretty optimistic' that the car could be rebuilt without incurring any drop.
The Finn, 64 points behind Hamilton, lost control into the last Peraltada corner and careered along the wall at speed before slamming into the end of the energy-absorbing Tecpro barrier.
He stayed in the car for a while, his breathing heavy over the team radio, before climbing out and going to the medical centre.
"We are 90% confident we can fix it (the damage) without any penalties. It was an unusual angle of impact so I think we got away with that," said team boss Toto Wolff.
Mercedes have already secured the constructors' crown for an unprecedented sixth year in a row and are also sure of a record sixth successive driver's title.
The accident prevented others from challenging the provisional pole time set by Verstappen on his first flying lap of the final session - even if the time of one minute 14.758 seconds already looked hard to beat.
"I had a mistake on my first run, so I was quite confident on the second run that I could make up for it but it was a double yellow (warning flag) so I had to slow down," said Vettel, who was on pole in Japan.
"We need a good start then take it from there - it’s a long race, it will be a tough one on brakes and cooling in general and tyres. All top six cars opt to start on medium tyres so we see who dares to go the longest."
Verstappen's British-born Thai team mate Alexander Albon qualified fifth.
McLaren's Carlos Sainz had another good Saturday, taking seventh ahead of teenage team mate Lando Norris in eighth with the two Toro Rossos of Daniil Kvyat and Pierre Gasly completing the top 10.
Mexican Sergio Perez qualified 11th for Racing Point.