Lewis Hamilton has returned to winning ways in the Monaco Grand Prix after a pit-stop blunder by Red Bull Racing cost Daniel Ricciardo a likely victory for the second event in a row.

A wet-to-dry race that started under the safety car but ended with the field on slick rubber, it was the crucial final stop that would ultimately cost long-time leader Ricciardo having established a mammoth 13secs lead initially.

Indeed, when Mercedes opted to keep Lewis Hamilton out longer on wet rubber as the rest of the field pitted for intermediates, when both came in for slick tyres a lap apart, an unprepared Red Bull pit box would haemorrhage seconds scrabbling to get the tyres out, allowing Hamilton the undercut he needed to snatch the lead and hold on to the end.

With the forecasted heavy rain making its presence felt throughout the morning and into the race, it was little surprise that it would begin behind the safety car, first time pole sitter Ricciardo leading the way from Nico Rosberg and Hamilton.

With the race getting underway properly on lap seven, despite Jolyon Palmer bringing out an instant Virtual Safety Car when he smashed on the home straight at the restart, Ricciardo swiftly put a margin between himself and Rosberg, at times lapping more than a second a lap quicker as the German backed up the field with apparent issues.

Later diagnosed as brake problems, Mercedes duly took the decision to swap Rosberg with his title rival, the defending champion up to second on lap 16 to immediately unleashing his pace but facing a 13secs deficit to the leader.

With the rain stopping and the circuit quickly transforming from wet to intermediate, the flurry of pit-stops onto 'green rubber' came in the run up to lap 20, with Ricciardo making his stop relatively on lap 22.

Hamilton, by contrast, opted to stay out, his pace still solid on the wet rubber, Mercedes attempting to roll the dice with a risky strategy to keep him on course - making the most of track position - despite Ricciardo cruising up behind him on better rubber in the hope they would need to pit at a similar time for slick tyres.

The Mercedes driver eventually pitted on lap 30 in what initially looked to be an erroneous move as he struggled on his out lap as Ricciardo - coming in for slicks himself - set strong times on his final intermediate lap.

However, Ricciardo would arrive in the pit lane to find no mechanics in his box, the team rushing to get the tyres out for him. Losing him several seconds stationary, though Hamilton himself was struggling to get up to speed, his effort was just enough to get him to turn one just ahead of his luckless rival.

From here it was a case of keeping the Mercedes out of the wall for Hamilton and to protect the ultra-soft tyres to the end, which would require a full 48 lap stint.

Indeed, though Ricciardo was rarely little more than a second behind him, Monaco's notoriously tricky bends would keep rebuffing the Red Bull and though he got particularly close at two Virtual Safety Car restarts, robust defence would keep the Mercedes in front.

Despite the onset of drizzle in the closing stages, Hamilton simply held firm to the chequered flag, crossing the line for his first win since the 2015 United States Grand Prix, a well-timed success on a day where championship leader Rosberg had little response down in seventh place.

Having released Hamilton early on, Rosberg proceeded to back up the chasing pack during the first stint, so much so that when he eventually made his stop for intermediate tyres, he slipped to sixth position, where he looked set to remain until the chequered flag, only to be overtaken on the final lap by Nico Hulkenberg.

It means his lead of 43 points has been slashed to 24 points heading to round seven and the Canadian Grand Prix.

Though overshadowed by the fight for the lead out front, Sergio Perez produced a magnificent performance in the Force India to secure a surprise podium result having started seventh.

The big winner from the first round of pit-stops having run slightly longer on wet rubber, a decision to fit soft tyres in the final stint - rather than ultra or super soft tyres - seemed to be inspired as he reeled off a series of fastest laps on the firmer compound. At one stage getting the gap to the front down to six seconds, though the tyres would go away late on, he still had the measure of Sebastian Vettel, who couldn't match his rival despite running a similar soft strategy in fourth.

Another beneficiary from the pit-stop strategy, playing caution to go slightly longer, Fernando Alonso picked up a well-deserved fifth place finish for McLaren from ninth on the grid, ahead of late mover Hulkenberg and the frustrated Rosberg.

The only relatively inexperienced driver to finish inside the points, Carlos Sainz will nonetheless be disappointed with eighth having run ahead of Perez early on, while Jenson Button and Felipe Massa picked up the final points after aggressive tyre strategies paid off.

A race of relatively high attrition and some controversy, Max Verstappen crashed out heavily at Casino on lap 35 having battled his way from the pit-lane to the top ten, while Kimi Raikkonen - second in the standings ahead of the race - slid off at Lowes early on, damaging his car enough to retire on lap 11.

Elsewhere, Renault endured a dismal afternoon after Palmer's early accident and a retirement for Kevin Magnussen, who suffered damage in two accidents, the first in clumsy contact with Daniil Kvyat - already fighting back after technical issues early on -, before sliding off at Mirabeau conclusively.

Meanwhile, Sauber faces its own inter-team controversy after Felipe Nasr ignored a team order to let Marcus Ericsson, before the pair collided at Rascasse, putting both out of the race.