Lewis Hamilton has won the Mexican Formula One Grand Prix, but Mercedes teammate Nico Rosberg remains in pole position to claim his first world title with two races remaining.

Hamilton's pole-to-flag victory was the triple world champion's eighth of the season and puts him level with France's Alain Prost in the all-time lists with 51 career victories.

Only Michael Schumacher (91) has won more.

Rosberg, who would have clinched the title had he won and Hamilton finished 10th or lower, finished 8.354 seconds behind to anchor champions Mercedes to their sixth one-two finish of the season.

The German, who holds a 19-point championship lead over Hamilton, can clinch the title if he wins the penultimate round at Sao Paulo's Interlagos circuit in Brazil in two weeks' time.

"Lewis has been too fast this weekend," said Rosberg. "I just have to accept second place."

Ferrari's Sebastian Vettel took third place when Red Bull's Dutch teenager Max Verstappen, who provided much of the afternoon's entertainment, was penalised after the chequered flag for gaining an advantage when going off the track.

"He has to let me go, he has to let me go," Vettel exclaimed furiously over the team radio as Verstappen refused to concede the place.

The German pulled level with the Red Bull driver after they crossed the line, raising his finger and wagging it theatrically.

Verstappen joined the Mercedes drivers in the waiting room before the podium ceremony but was then hauled out after stewards imposed a five second time penalty and Vettel had to run down the pit lane to the podium.

In a race that saw all but one of the 22 starters finish, the safety car was deployed on the second lap when Mexican Esteban Gutierrez tagged Pascal Wehrlein's Manor and pushed him into Marcus Ericsson's Sauber.

There was more drama at the front where Hamilton made a good getaway but then locked up and trekked across the grass, cutting the first corner without consequence.

Verstappen and Rosberg made contact behind him, with the Dutch driver trying to find a way through on the inside from third place on the grid, but race stewards decided to take no further action.

Australian Daniel Ricciardo finished fourth for Red Bull, moved up by Verstappen's penalty with the Dutchman classified fifth.

Ferrari's Kimi Raikkonen finished sixth, Nico Hulkenberg seventh for Force India and the Williams pairing of Valtteri Bottas and Felipe Massa eighth and ninth.