The Briton ducked superbly inside his fierce rival on the 29th lap of a race halted after an accident involving Marussia’s Jules Bianchi to win at Suzuka for the first time.
He increased his advantage over German Rosberg to 10 points with four rounds left this season.
Reigning world champion Sebastian Vettel finished third for Red Bull.
Frenchman Bianchi underwent emergency surgery after crashing in slippery conditions near the end of an incident-packed Japanese Grand Prix.
Formula One’s governing International Motoring Federation (FIA) said the 25-year-old had been rushed to hospital after suffering a “severe head injury” and had gone into surgery.
Bianchi was taken to hospital by ambulance, still unconscious, after colliding with a recovery vehicle which was attempting to lift Adrian Sutil’s Sauber away from danger after the German himself had skidded into a wall on lap 42 at Suzuka.
The FIA said that Bianchi would continue to be monitored in intensive care following his operation.
“The driver was removed from the car, taken to the circuit medical centre and then by ambulance to Mie General Hospital,” FIA press officer Matteo Bonciani said in a statement.
“The CT scan shows that he has suffered a severe head injury and he is currently undergoing surgery. Following this he will be moved to intensive care where he will be monitored.”
The FIA added: “A recovery vehicle was despatched in order to lift (Sutil’s) car and take it to a place of safety behind the guardrail. While this was being done the driver of car 17, Jules Bianchi, lost control of his car, travelled across the run-off area and hit the back of the tractor.
“Once the marshals reported that the driver was injured, medical teams were despatched and the Safety Car was deployed. These were followed by an extrication team and an ambulance.”
“Jules is seriously injured,” Bianchi’s father Philippe told France 3 television. “He is undergoing surgery for a head injury and we will need to wait 24 hours to know any more on his condition.”
Championship leader Hamilton won Sunday’s race, which had been threatened by a typhoon and began behind the safety car with drivers complaining over team radios that they were unable to see through the spray.
Starting in second behind Mercedes team-mate Nico Rosberg, Hamilton had radioed: “Tell Nico not to do anything dramatic cos I can’t see him.”
Sutil witnessed Bianchi’s shunt after going out himself.
“I had a spin and ended up in the wall,” he said. “I stood up and they tried to rescue the car. Jules was in the same area and lost the car. Hopefully he is in good hands.”
The safety car and medical car were sent out and the race brought to a premature halt, giving Hamilton his eighth victory of the season, although the Briton’s celebrations were muted as news of Bianchi’s accident filtered through.
“We’re all very concerned about our colleague, Bianchi,” said Hamilton. “I don’t really know what to say.
Obviously (the race) didn’t finish the way we would have hoped but really, my prayers are with him and his family.”
German Rosberg, who finished second, said: “I’m not thinking about the race — I’m thinking about my colleague. I’m hoping for the best.”
Formula One has been relatively free of bad crashes in recent years following safety-improving measures that were implemented in the wake of the last fatality to hit the sport – that of Ayrton Senna at the 1994 San Marino Grand Prix.
The safety car came out again after 44 laps and the race was suspended two laps later as with the rain getting heavier and the light rapidly deteriorating.
There was no traditional spraying of champagne on the podium with news already having filtered through of Bianchi’s crash. The Frenchman was taken to hospital by ambulance.
The early halt was little surprise after German Adrian Sutil smashed his Sauber into a wall, Bianchi then involved in a collision with a recovery vehicle, prompting the safety car and medical car to appear and the race to be stopped seven laps early.
Hamilton, the 2008 world champion, produced one of the overtaking moves of the season when he daringly passed Rosberg on the outside of turn one and stormed away to claim his eighth victory of 2014 and the 30th victory of his career.
Vettel, the four-time defending title holder, who announced on Saturday he will leave Red Bull at the end of the season, made the podium for the second race in a row — but only his fourth of the year — ahead of Australian team-mate Daniel Ricciardo.