The defending three-time world champion, who started from pole position, attacked the championship leader who defended hard at Turn Two and drove into him.
Rosberg forced Hamilton off the track, but the Briton rejoined, the pair touching briefly again, and pulled clear to win. Behind him, Rosberg suffered a damaged front wing and dropped back to finish fourth.
The collision concluded a titanic contest between the two Mercedes men after an incident-packed race that left Mercedes team bosses describing their drivers as ‘brainless’.
Dutch teenager Max Verstappen claimed his second career podium finishing second for Red Bull ahead of third placed Finn Kimi Raikkonen for Ferrari.
Rosberg was fourth ahead of Australian Daniel Ricciardo in the second Red Bull, Briton Jenson Button of McLaren Honda, Frenchman Romain Grosjean of Haas and Spaniard Carlos Sainz of Toro Rosso.
The stewards announced an inquiry into Rosberg’s part in the final lap collision for continuing with a damaged car as Hamilton was jeered by the crowd as he stood on the podium.
“I was on the outside,” said Hamilton, on team radio. “It wasn’t me that crashed.”
Hamilton’s win ended Rosberg’s hopes of a third consecutive victory and cut the German’s lead in the title race from 24 points to 11 ahead of next weekend’s British Grand Prix at Silverstone.
It was the 46th win of his career.
“What an incredible race,” said Hamilton, amid the jeers. “It was tough. Apart from this (the crowd reaction), I love it here I don’t know what that’s about. It’s not my problem. It’s their problem.”
After four poor previous starts from pole this year, Hamilton made a near perfect getaway and eased clear while Hulkenberg, from second, fell back. Button grabbed second ahead of Raikkonen.
The world champion was soon showing he was in charge on the low-durability ultra-soft tyres, surprising many observers, while Rosberg climbed to third before he pitted after 11 laps.
By then, Button, who had held Raikkonen behind him for six laps, was falling away and the Ferraris were closing in, Raikkonen running second and Vettel, on his 29th birthday, third by lap 16 with Rosberg, on new super-soft tyres, fourth, but 29 seconds adrift of the leader.
Tyre wear and strategy were clearly key factors in the contest.
Hamilton finally pitted from the lead after 22 laps, but a problem with his left rear slowed his stop for super-softs and gifted Rosberg a chance to pass him.
Raikkonen led, but pitted himself after one further lap and Vettel, who started eighth, took control at the front until lap 27 when his rear right tyre exploded on the main straight.
His Ferrari swerved into the inside barriers and then slewed back across the circuit, just avoiding a collision with the oncoming cars. The Safety Car was deployed and a series of cars dived into the pits immediately.
“There were no signs of a failure,” said Vettel afterwards. “It was fine. Other people went as long or longer. I don’t know much why it happened.”
Five laps later, racing resumed with Rosberg leading ahead of Hamilton, Verstappen and Ricciardo. Ferrari’s opportunity to win had blown up with Vettel’s tyre.
Rosberg was racing on tyres that were 11 laps older than Hamilton’s and led him by two seconds on lap 37 as the Englishman bided his time, the pair trading fastest laps.
The leading pair were nearly 12 seconds clear of third-placed Verstappen as the race unfolded increasingly as a test of tyre management.
Having favoured Rosberg with an early stop, Mercedes had the option to hand track position back to Hamilton with a strategic pit-stop decision.
When it came, Hamilton came in after 54 laps for a 3.5 seconds stop and Rosberg, surprisingly, just one lap later, for a slick 2.3 seconds stop.
To accentuate the rivalry between them, Hamilton was given a set of used ‘softs’ and Rosberg a new set of ‘super-softs’ and the champion, on his ‘out’ lap ran wide at Turn Two.
Rosberg retained the lead, by 1.2 seconds.
“Why is he on a softer tyre than me?” barked Hamilton on the team radio. No reply was broadcast.
A straight scrap over the closing laps was in prospect with increasing signs of acrimony.
The double stop by the Mercedes men had given Verstappen the lead. Rosberg, with Hamilton in close attendance, attacked on lap 61 and finally squeezed past at Turn Three, leaving Hamilton third.
For Hamilton, it was a chance to avenge a perceived injustice and on lap 63 he lapped compatriot Jolyon Palmer’s Lotus and passed Verstappen in the same move to set up a chase after Rosberg over the final six laps.