Lewis Hamilton won the Mexican Grand Prix with a superbly controlled drive in a tactical fight with Ferrari to move to the brink of the world title.
Hamilton will clinch his sixth championship at the US Grand Prix next Sunday as long as he does not lose more than 22 points to Mercedes team-mate Valtteri Bottas.
Hamilton triumphed in a tense, slow-burn race of divergent strategies between the four Mercedes and Ferrari drivers.
Ferrari's Sebastian Vettel was second, ahead of Bottas and Charles Leclerc.
The four men closed up in the final laps as their different tactics came together.
While Mercedes could congratulate themselves on gambling on a one-stop strategy with a long second stint to gain track position on Vettel and then hold off the German to the end, there will be questions over Ferrari's decisions.
The Italian team twice gave up the lead, first with pole position winner Charles Leclerc, who was pitted out of first position after 15 laps to stick to a two-stop strategy decided before the race.
And Vettel took his strategy into his own hands to decide to do the same when Hamilton made his stop.
Ferrari had the chance to pit on the next lap and retain the lead, but Vettel suggested they "leave him to it", a decision that meant they would stop later and try to come back at Hamilton at the end of the race on fresher tyres.
Vettel had tyres that were 14 laps fresher than Hamilton's for the climax to the race, but the reigning champion was more than capable of holding the Ferrari back.
Even champions need reassuring
But the win was not without anxiety for Hamilton, who shortly after his pit stop questioned whether they had given him too long to make the tyres last, and who was also battling a car damaged by the contact with Verstappen.
He complained so much that Mercedes chief strategist James Vowles came on the radio, a rare event used only at critical moments, to reassure Hamilton: "You can do this."
In the closing laps, as Vettel was urged on by Ferrari, Hamilton was able to hold his advantage at just over two seconds and take his 10th win in 18 races this season.
He leaves Mexico City, where he tied up the championship in both the last two seasons, with a 74-point lead over Bottas, the only man who can mathematically beat him.
He needs to leave Austin, Texas, next weekend with a lead of 52 points to become only the second man in history to win more than five F1 world titles.
The only way that can't happen is if Bottas wins and Hamilton finishes lower than eighth, a highly unlikely scenario in normal circumstances, especially at a circuit where Hamilton has excelled since its debut on the calendar in 2012.
How did Ferrari get it wrong?
The divergent strategies meant that for the third race in a row Ferrari had turned first and second on the grid into a poorer race result.
A chaotic first lap took Red Bull's Max Verstappen out of the picture, the Dutchman dropping to ninth place as he tangled with Hamilton, who had an oversteer moment as they disputed third behind the Ferraris at Turn Two.
On the run down to the first corner, Hamilton, who started third, had been challenging Vettel for second behind Leclerc, but was edged on to the grass by the Ferrari.
Ferrari had the one-two positions they would have wanted at the end of the first lap but somehow they still conspired to lose the race.
The first error was pitting Leclerc out of the lead on lap 15 when they did not need to.
That ruined Leclerc's race and consigned him to a fourth place finish as the two Mercedes drivers and Vettel ran long and committed to one-stop strategies.
With Vettel, Hamilton and Bottas running one-two-three, the key then was whose one-stop would triumph and Vowles' decision to pit Hamilton early in a successful attempt to get ahead of Vettel into the lead was critical.
When Hamilton stopped on lap 23, leaving him 48 laps to go to the flag, Vettel decided to surrender the lead and stay out, with Bottas doing the same behind him to cover their bases.
Despite Hamilton's concerns, he was able to eke out his tyre life and take an excellent win.
Behind Leclerc, Red Bull's Alexander Albon took fifth. He had run third in the opening laps behind the Ferraris but was the first to stop and lock himself in a two-stop strategy.
Verstappen recovered to finish sixth ahead of Racing Point's Sergio Perez and Renault's Daniel Ricciardo on a terrible day for McLaren.
Carlos Sainz and Lando Norris had started seventh and eighth, but Norris retired after a bungled pit stop in which he was sent away without his left front wheel attached, while Sainz faded to 13th, lacking pace.
More about: F1