The 31-year-old Briton came home comfortably ahead of the German to trim his advantage to 19 points
The 31-year-old Briton came home comfortably ahead of the German to trim his advantage to 19 points with two races remaining after a fiery finish to the 71-lap race.
This saw four-time champion Sebastian Vettel lose his temper during a tempestuous exchange following a clash with Dutch teenager Max Verstappen of Red Bull.
The conflict was settled by the stewards who swiftly handed the Dutchman a five-second penalty for gaining an advantage when he went off the track at Turn One.
Verstappen, who had finished third, had already taken his place in the pre-podium room with the two Mercedes drivers before the stewards' decision was taken - while Vettel fumed and gave vent to a stream of profanities - but made a hasty retreat when the German came to the room.
However, almost three hours after the race had ended, Vettel was penalised 10 seconds and demoted from third to fifth after officials deemed he had made a dangerous blocking move on Red Bull's Daniel Ricciardo.
That moved Ricciardo up to third and Verstappen to fourth.
But the final fury could not overshadow a near-flawless drive by Hamilton to his second win in succession, his eighth of the season and the 51st of his career.
"It's my first win in Mexico and for that I am very happy," said Hamilton. "Nico is doing a great job and I just aim to keep winning. It's all I can do."
Hamilton also went off-circuit at Turn One on the opening lap, but without being penalised - in much the same way that Verstappen was to in the closing laps - before he settled and drove with his customary elan.
Rosberg said: "It's been a good day. I haven't been too fast this weekend so I have to accept second. I got shunted at the start and had a battle with Max Verstappen late on, so second is ok."
Vettel was still fuming on the podium -- although his mood would have got a lot darker later when he was punished.
"He (Verstappen) left the track and didn't move and so you can understand why I was annoyed."
Sixth was Kimi Raikkonen in the second Ferrari while Nico Hulkenberg was seventh for Force India.
Valtteri Bottas finished eighth for Williams ahead of his team-mate Felipe Massa and local hero Sergio Perez who claimed the final point in the second Force India.
The Mercedes team's one-two victory was a record 17th for the season and it was Hamilton's 30th win from pole position.
Only seven-time champion Michael Schumacher has more on 40.
Hamilton is now level with four-time champion Frenchman Alain Prost on 51 wins.
Rosberg can clinch his maiden drivers' title if he wins the Brazilian Grand Prix at Interlagos, a circuit on which Hamilton has never won, on November 13.
On a bright and dry afternoon at the Autodromo Hermanos Rodriguez, a crowd of around 110,000 generated a raucous atmosphere before the lights went out for the start.
Hamilton, after a sluggish first phase to his launch from his 10th pole position of the season, pulled clear to lead the 900-metres run down to Turn one where he locked up heavily, creating a flat spot on a tyre, and ran off circuit.
Lucky for the Englishman, there were no kerbs as he speared across an asphalt run-off area and an area of grass before rejoining ahead of Rosberg who, in turn, had survived a minor clash with Verstappen's Red Bull and also rejoined after running off.
That incident required a stewards inquiry which resulted in no action taken.
Verstappen, as so often, was providing much of the entertainment as he hunted down Rosberg.
When the German locked up, on lap 49, the teenager passed him at Turn One with a lunge down the inside, but he was unable to control it and ran wide.
Vettel closed to within 2.5 seconds of Verstappen and then, with four laps remaining, pressurised the young Dutchman into an error at Turn One, where he out-braked himself and ran across the grass
That was the incident which caused the controversy and penalties which followed.