Red Bull's Daniel Ricciardo was third, followed by Ferrari's Sebastian Vettel and Max Verstappen of Red Bull.
Hamilton now has five F1 victories this season for 192 points, with Rosberg on 186 and Ricciardo third with 115.
Rosberg won the first four races this year, while Hamilton has won five of the last six. Verstappen is the only non-Mercedes driver to win a race in 2016.