Hamilton exclaimed "No, no, no" after he realised he had suffered the engine failure from first place, 22 seconds ahead.
"I've just got to move on," Hamilton told Sky Sports.
I just can't believe that there's eight Mercedes cars and only my engines are the ones that have gone. Something just doesn't feel right.
Hamilton had been on course to win and reclaim the championship lead as he built up a 22.7s lead over Ricciardo but his engine expired on the approach to Turn 1 with 15 laps to go.
Lewis Hamilton walks away after his engine catches fire at the Malaysian Grand Prix
Image credit: Reuters
The Briton cried "Ah, no, no, no" as he pulled to a stop at the side of the track, climbing out of the car, squatting down and placing his head in his hands.
The virtual safety car was called with Ricciardo, who was running nose-to-tail with Verstappen at the time, pitting along with his Red Bull team-mate for soft tyres as they had a 40-second gap back to Nico Rosberg.
They rejoined comfortably ahead of the German and though Verstappen ran close behind, Ricciardo absorbed the pressure to take his first victory of the season.
After Ricciardo had a chance to celebrate the victory, he made a powerful statement by dedicating the win to the late Jules Bianchi.
Red Bull's Daniel Ricciardo of Australia during the Malaysian Grand Prix