Former four-time world champion Sebastian Vettel finished third for Ferrari, having jumped the Mercedes pair at the start and leading until his final pit stop.
Pole-sitter Hamilton endured a horror start to the defence of his world championship crown after he slipped to sixth on lap one, but he fought back to finish second.
Rosberg, who has now four races on the spin following his strong end to last season, said: “It has been a great weekend, thank you to the team, they have done an unbelievable job and to beat the Ferraris was great.”