Ricciardo led the race from the opening lap having claimed a dominant pole position on Saturday and looked to have it under control until he reported a loss of power on lap 18.
Drivers were lapping several seconds off the pace as they managed tyres to ensure they were able to do only one pit stop.
Daniel Ricciardo brought back memories of Formula One great Michael Schumacher in his prime on Sunday as the Australian nursed a wounded Red Bull to Monaco Grand Prix victory in the team's 250th race.
"We sent a statement on Thursday and have been quickest every session".
Note: Hamilton's tyres went for 40 more laps, until the end of the race.
The Red Bull driver was 0.229s clear of Sebastian Vettel in second place and faced no opposition from teammate Max Verstappen after damage to the Dutchman's auto following a crash in final practice that proved too extensive to fix in time for qualifying.
Ricciardo has now jumped Mercedes Valtteri Bottas to move into third in the drivers' standings, 24 points behind Vettel and 38 behind Hamilton.
"It feels a little bittersweet".
"At the end I was pushing a bit more but it was still costing me, I don't know, I would say over a second, definitely over a second a lap, it was a lot and also because that the rear brakes get hot, because of the "K" that failed, so the rear brakes got really hot we had to go seven percent forwards with the brakes". Verstappen will start from the back on Sunday, and could struggle to work his way through the field even in the quickest auto: Overtaking at Monaco is notoriously hard.
"But this place bites hard if you abuse it and Max is a very fast driver, that is in no doubt, and this weekend we have a very fast auto and he should have been competing for the front row. It's frustrating with such a fast auto not to have both cars on the front row of the grid", said team boss Christian Horner. He should have been competing for the front row today.
Nearly two years ago to the day, Daniel Ricciardo was denied a maiden Monaco Grand Prix victory due to a sluggish pit stop and only on Sunday was he able to finally step atop the principality podium.
"There is no more brutal lesson than what he has had and hopefully he is smart enough to learn from that".
Ricciardo's only previous pole had been in Monaco two years ago, when he lost out to Hamilton on strategy and finished runner-up.
"I gave it everything I could".
A virtual safety auto period ensued, and Ricciardo was the main beneficiary as he emerged five seconds clear of Vettel with just three laps to go.
"It's still a long race ahead of us tomorrow".
Renault's Carlos Sainz lines up eighth with Force India's Mexican Sergio Perez, who holds the current race lap record that is sure to be bettered on Sunday, in ninth and Frenchman Pierre Gasly 10th for Toro Rosso.