Mexico City - Ferrari's Sebastian Vettel seized his 50th Formula One pole position at the Mexican Grand Prix on Saturday with title rival Lewis Hamilton third on the grid and poised for a fourth world championship.
The German now has a great chance to win Sunday's race, barring any recurrence of Ferrari's recent reliability problems, but he also knows the title outcome is out of his hands.
Hamilton has a 66-point lead over Vettel, a four-times champion, and the Mercedes driver will become Britain's first quadruple title holder with two races to spare if he finishes fifth.
"It depends on Lewis. For us, we go all out. We deserve a good result so let's see what we can do tomorrow," Vettel told reporters.
Hamilton, last year's winner from pole, had expected a difficult session and congratulated the German on his milestone.
"I tried to deny him but it wasn't to be. It was a difficult session and it has been a difficult weekend," said the Briton, who holds the all-time record of 72 pole positions and was chasing his 10th of the season.
"They did a great job and their car was working better than ours this weekend, but I am still there in the fight," added the 32-year-old, who feared overtaking would be difficult at the high-altitude Autodromo Hermanos Rodriguez.
Red Bull's Max Verstappen, who had looked like becoming the sport's youngest pole-sitter until Vettel's late final lap of one minute 16.488 seconds, qualified alongside Vettel on the front row.
Hamilton was 0.446 seconds off Vettel's time.
Verstappen had risked losing his front-row slot after being summoned to the stewards for allegedly impeding Hamilton's team mate Valtteri Bottas in the second phase of the session, but they decided to take no further action.
The Dutch driver, who has had several run-ins with stewards and was demoted from third to fourth after last weekend's US Grand Prix for exceeding track limits, was already frustrated not to be starting from the top slot.
"Second is good but not given the way it went. I really wanted that pole position," said the 20-year-old, who played down the incident.
"It's his own problem if he outbrakes himself at the next corner. I was on the inside and didn't hold him up," he told Sky Sports television. "I moved to the inside and was past the point where you go to the right. I don't see an incident."
Bottas, who said Verstappen had definitely ruined his lap, will start alongside Hamilton in fourth place with Ferrari's Kimi Raikkonen fifth.
French driver Esteban Ocon qualified sixth and ahead of Force India team-mate and local hero Sergio Perez, who will line up a disappointing 10th.
The two team-mates had several spats earlier in the season, with Ocon accusing the Mexican of trying to kill him at the Belgian Grand Prix in August and receiving death threats on social media.
The pair have subsequently mended fences and Perez has called on his fans to show respect to his team-mate.
Australian Daniel Ricciardo qualified seventh with the Renault pairing of Nico Hulkenberg and Carlos Sainz in eighth and ninth.
Ricciardo said he had struggled to get the tyres up to temperature.
"This afternoon should have been a breeze to warm the tyres up and get them going so that's where it's more confusing," he said.
"If we figure it out and get back to the car we had for the rest of the weekend then I think we can race up to a podium. I was helpless in that qualifying."
New Zealander Brendon Hartley, in only his second race for Toro Rosso, qualified 13th after stopping on track during the second phase with engine problems that could herald a grid penalty.
1. Sebastian Vettel (Germany) Ferrari
2. Max Verstappen (Netherlands) Red Bull - TAG Heuer
3. Lewis Hamilton (Britain) Mercedes
4. Valtteri Bottas (Finland) Mercedes
5. Kimi Raikkonen (Finland) Ferrari
6. Esteban Ocon (France) Force India - Mercedes
7. Daniel Ricciardo (Australia) Red Bull - TAG Heuer
8. Nico Huelkenberg (Germany) Renault
9. Carlos Sainz Jr (Spain) Renault
10. Sergio Perez (Mexico) Force India - Mercedes
11. Felipe Massa (Brazil) Williams-Mercedes
12. Lance Stroll (Canada) Williams-Mercedes
13. Brendon Hartley (New Zealand) Toro Rosso - Renault
14. Marcus Ericsson (Sweden) Sauber - Ferrari
15. Pascal Wehrlein (Germany) Sauber - Ferrari
16. Kevin Magnussen (Denmark) Haas - Ferrari
17. Romain Grosjean (France) Haas - Ferrari
18. Fernando Alonso (Spain) McLaren
19. Stoffel Vandoorne (Belgium) McLaren
20. Pierre Gasly (France) Toro Rosso - RenaultReuters