Lewis Hamilton kept his title hopes alive with a comfortable victory from Mercedes team-mate Nico Rosberg in the Mexican Grand Prix.
Hamilton survived a scare at the start, when he ran wide at the first corner after locking a front tyre.
But otherwise he was untroubled en route to his 51st career win.
Heart in mouth: Hamilton locked a wheel and went wide at the first corner
In the championship, the result changes little, and Rosberg can win the title by finishing second to Hamilton at the last two races of the season.
Hamilton is 19 points adrift with a total of 50 available in Brazil and Abu Dhabi.
Hamilton is now joint second in the all-time winners' list
Rosberg can now regroup after a weekend on which Hamilton was in almost total control throughout.
The German will doubtless keep to his well-worn mantra that he is taking it one race at a time and trying to win each one, but he has the luxury of knowing he can afford to take it easy in both remaining races and clinch his first will title.
Rosberg also had a scare, and a more eventful race than Hamilton, as 120,000 fans had little to excite them under blue skies and warm sunshine in Mexico City, until some frantic and bad-tempered late action in a battle over third place between Red Bull's Max Verstappen, Ferrari's Sebastian Vettel and Red Bull's Daniel Ricciardo.
Hamilton became the first Briton to win in Mexico, after John Surtees (1966, pictured) and Graham Hill (1968)
Hamilton spent the first stint controlling his pace to ensure he did not overwork his damaged tyre, while Rosberg was under pressure from Verstappen.
Rosberg and the Dutchman had collided at the first corner as Verstappen tried to take second place, Rosberg taking to the grass behind Hamilton after the collision.
The incident was investigated by the stewards but given the all-clear.
It was a foretaste of what was to come.
As Hamilton controlled the race - on the way to a victory that puts him equal with Alain Prost in second place in the all-time winners' list, with Michael Schumacher way ahead on 91 - Rosberg spent much of the afternoon watching his mirrors for Verstappen.
The entertainer: Verstappen closes in on Rosberg before sliding across the track while attempting to overtake him
There was stalemate for a long time, until Rosberg locked up into Turn One on lap 50 while trying to lap Toro Rosso's Carlos Sainz.
Verstappen saw his opportunity and dived down the inside into Turn Four. Although he was briefly ahead, he could not stop in time and ran wide, sliding thrillingly across the track on opposite steering lock, and Rosberg regained the place.
It was Verstappen's one and only chance. Once he was back up to speed, the gap was out to 2.5 seconds and Rosberg edged gently away for the rest of the race.
Red Bull's gamble of starting on the super-soft tyres to try to mix it with the Mercedes did not really pay off, but it led to a frantic battle in the closing laps.
Instead of challenging Rosberg, Verstappen found himself under pressure in the closing laps from Vettel and Ricciardo.
Uncompromising: Verstappen said after the race Vettel is always moaning and swearing over the radio
Vettel started on the soft tyre like the Mercedes and ran a very long 33-lap first stint, leading for 16 laps after Hamilton's first stop.
That gave him tyres that were 20 laps fresher than Verstappen's for the final stint and he closed in inexorably until he was within 1.2secs with six laps to go.
Vettel locked up at the first corner on lap 68 and ran wide over the grass, cutting the corner and keeping hold of third place, the German complaining he should be given the position as Verstappen was advised by his team to hand it over.
But he kept fighting as Vettel tried to pass, the four-time world champion claiming the Dutchman was backing him into Ricciardo, who fought back through the field after a first-lap stop put him on a two-stop strategy.
That's two wins for Mercedes in Mexico: same as Ferrari, who won in 1970, and 1990 with Alain Prost, above. Source: Forix
The three were nose to tail at the start of the penultimate lap and Vettel was right on the edge in holding Ricciardo back as he tried to pass into Turn Four.
The incident spread the gap between the three cars and Verstappen crossed the line in third, from Vettel and Ricciardo.
But Verstappen's cutting of the first corner was investigated by the stewards on the grounds he might have gained an advantage by leaving the track and in dramatic scenes Verstappen was given a five-second penalty immediately after the race and was demoted to fifth.
Verstappen was forced to leave the pre-podium room as Vettel ran to take up his place on the podium.
Manor's Pascal Wehrlein came to grief on the first lap after colliding with Sauber's Marcus Ericsson
Vettel earlier fumed over the radio, using several expletives in telling his team how unhappy he was with race director Charlie Whiting.
He and Verstappen then gesticulated at each other after crossing the line, Vettel wagging his finger at Verstappen.
There could yet be further changes as Red Bull are angry about Vettel's defence against Ricciardo, claiming he had broken new guidelines forbidding moving under braking and may protest.
Lewis Hamilton: "This is honestly the best crowd we get anywhere. In our home country it is always great, but these guys have such a great passion.
"I love it here. I have had tacos every night.
"Nico is doing a great job. I'm really grateful the team did a great job."
Sebastian Vettel on his clash with Verstappen: "I was using a lot of sign language. You have to understand the adrenaline.
"Then obviously he left the track and didn't move and so you can understand why I was annoyed. I was really disappointed when I crossed the line."