The defending world champion started second on the grid, inherited the lead when Rosberg slowed and then retired, after seven laps, with throttle pedal problems and claimed his ninth win of the season.
With this 42nd career win he passed his boyhood hero Ayrton Senna's tally in the record books.
And crucially it lifted the Briton up to 302 points in the world championship, with Sebastian Vettel, who took second in his Ferrari, now on 236 points, 66 adrift, with Rosberg now 73 points behind on 229.
"I honestly did not know that, but I am just going to take it race by race and concentrate on that," he said.
More From This Section
"I don't take what we have granted, but It's a special moment for me to surpass Ayrton."
Despite his ill luck Rosberg refused to concede the title.
"Formula One is pretty incredible sometimes, how tough it is," he said.
"I am never going to win a championship like that when normal things break on a day when I should have won the race, but I will come back, as I always do."
An opening lap multi-car collision caused the first safety car.
The second came after 12 laps when Romain Grosjean crashed heavily in his Lotus and climbed out of the wreckage unhurt.
Another crash on the final lap, involving Finns Kimi Raikkonen of Ferrari and Valtteri Bottas of Williams as they battled for third gave the position instead to Sergio Perez who claimed only the third podium in the Force India team's history.