Rosberg's title comes 34 years after his father won the title, and makes them just the second father-son combination to win the title.
The German only needed a podium finish to guarantee him his first champion, and did all he needed during the race.
Hamilton took off from pole position into an early lead that he would never relinquish. During the final part of the race, he defied calls from the team to speed up, slowing the pace down in a last-ditch attempt to back Rosberg into the charging Sebastian Vettel and Max Verstappen - Had they both got by Rosberg, the championship would have gone to Hamilton.
Alas, the tactic would not pay off, with Verstappen's tyres going off and him dropping back, while Vettel was unable to find a way past Rosberg who held on to second to clinch the championship by five points.
At the start, Kimi Raikkonen, who got by Daniel Ricciardo and Vettel, to get into third and stuck by the Mercedes pair, while Max Versstappen spun to the back of the field after contact with Nico Hulkenberg.
Both Mercedes held onto their lead through the pit stop cycle, crucially being held back as the Ferraris entered at the same time.
Rosberg emerged behind a slow Verstappen - who had moved up to second place by virtue of his long first stint - and made arguably his only risky move of the race by getting by the young Dutchman through turns eight and nine.
From then on the Mercedes men were almost guaranteed for a one-two finish until the closing moments when Vettel, who had got by both Red Bulls and was closing in on Rosberg who was being backed into the Ferrari driver by Hamilton, but to no avail.
Mercedes pleaded with Hamilton two get him to speed up to negate the threat from Vettel, but Hamilton insisted that they "let us race". He later insisted over the radio that he didn't care whether he won or lost the race as the positions him and Rosberg were in would give his team mate the championship.
Hamilton's win was his tenth of the year, giving him the unenviable record of the most wins in a season without the championship.
Verstappen finished the race in fourth, ahead of Ricciardo and Raikkonen.
Esteban Ocon and Pascal Wehrlein were 13th and 14th, ahead of both Saubers, while Jolyon Palmer was the final finisher - despite a collision with Carlos Sainz which saw him handed a five second time penalty.
Sainz retired from the race with a gearbox problem, likely to be a result of the collision with Palmer.
Jenson Button, the second driver retiring from F1 after today's race unfortunately ended his career with a retirement too, with a rare suspension failure taking him out of the race.
Bahrain International Circuit - Winter testing