"God blessed me today for sure", said Hamilton, who set a lap record on his way to a third win in a row, in podium interviews.
"I think there was damage on the auto already", he said of his second incident. Who would've known that would happen.
Sebastian Vettel was left downbeat after a clash with Ferrari teammate Kimi Raikkonen and Red Bull's Max Verstappen caused him to retire from the Singapore Grand Prix on the opening lap, hurting his championship hopes.
"I realise that", responded the driver.
At the same time, auto 5 which had a slower start, moved to the left hand side of the track; vehicle 33 and vehicle 7 then collided resulting in a chain collision with auto 5 and ultimately auto 14 (Fernando Alonso) at the next turn.
Remarkably, that gave main title rival Lewis Hamilton - whose prospects of a strong race looked bleak in the dry when he qualified fifth - the lead of the race as the Safety Car came out while the damaged cars were removed from the circuit.
Vettel had got around the first corner ahead, but then spun, and with his vehicle badly damaged he retired from a race for the first time in 2017. "It's wonderful points", said Hamilton after Sunday's success, his seventh of the season.
Championship leader Lewis Hamilton, who led Vettel by three points before the start, jumped into the lead from fifth place on the grid.
Australian Ricciardo had been confident of victory, despite missing out on pole on Saturday but could not keep up with the Briton's pace on Sunday.
"I can't win the bloody thing! I'm trying", he said afterwards. If I make a mistake myself and go off, that's a different story.
Belgian rookie Stoffel Vandoorne was seventh for McLaren ahead of Canadian teenager Lance Stroll in the Williams and Romain Grosjean in the Haas.
Esteban Ocon rounded out the points paying positions in tenth place for Force India after being locked in an ongoing battle with the two Haas drivers and Felipe Massa.
Daniil Kvyat, Marcus Ericsson (both accidents), Hulkenberg and Kevin Magnussen (both mechanical) joined the big names on the DNF list before the end of the race - which was shortened from the scheduled 61 laps to just 58 inside the two-hour time limit by the various safety vehicle interventions - but there was little drama out front, with the biggest question marks surrounding the point at which it was judicious to move from grooved rubber to slicks. Only 12 of the 20 cars finished.