Lewis Hamilton took a superb victory in a close battle with Red Bull's Daniel Ricciardo in a thrilling Monaco Grand Prix to re-ignite his title campaign.
Hamilton's first win this year cut his deficit to Mercedes team-mate Nico Rosberg, who finished seventh, to 24 points.
The world champion benefited from a slow pit stop for Ricciardo but also from his own brave call to delay a tyre change on a drying track until he could go straight to slick tyres.
He then had to defend from Ricciardo for 45 laps to win.
It was a masterclass of defensive driving that at times recalled McLaren's Ayrton Senna holding off the faster Williams of Nigel Mansell in the closing stages of this race in 1992, a battle that has gone down in Formula 1 folklore.
Lewis jumps for joy after winning the Monaco grand prix
The race started behind the safety car on a soaking track and victory hinged on Hamilton's decision to ignore his team's request to come in to switch to 'intermediate' wet tyres, as a step between the full wets on which everyone had started the race and the untreated slicks.
He was the only driver to do that and the decision ensured he moved into the lead after starting third behind Ricciardo and Rosberg.
Mercedes said the decision was a joint one between driver and pit wall.
When the race started on lap eight, Ricciardo quickly built a huge lead as Rosberg struggled in the difficult conditions, for which Mercedes blaming brake-temperature problems.
On lap 16, by which time Ricciardo was 13.1 seconds in front, Mercedes ordered the German to let Hamilton by and the Briton quickly pulled away at more than two seconds a lap.
Hamilton could only cut two seconds from Ricciardo's advantage until Red Bull's decision to fit intermediate tyres to Ricciardo's car on lap 23 gave Hamilton the lead.
The Australian quickly closed back in as Hamilton hung on despite his rapidly deteriorating 'extreme' wet tyres, making his sole pit stop on lap 31 and choosing the softest ultra-soft tyres.
Ricciardo lost the race when his team failed to get any tyres out of the garage when he entered the pits
Ricciardo stopped on the very next lap - choosing the slightly harder super-softs -and would have re-taken the lead but for the fact that he was delayed in the pits because Red Bull did not have his tyres ready.
That gave Hamilton enough time to reclaim the lead and Ricciardo rejoined right behind him.
He had some scary moments as Ricciardo attacked for the rest of the race, none more so than on lap 37, following a restart after one of many virtual safety car period, this one for a heavy crash for the second Red Bull of Max Verstappen.
It was the third crash in two days on a chastening weekend for the Dutchman, who won in Spain on his debut for Red Bull last time out.
As racing resumed, Ricciardo was right with Hamilton as they sped through the tunnel and Hamilton went too deep into the chicane, bouncing over the kerbs.
Ricciardo began to move alongside on the outside as they left the corner, but Hamilton gave him a squeeze and Ricciardo had to back off, uttering an expletive over the radio.
Lewis Hamilton clearly delighted to receive the winner's trophy
The incident was investigated by the stewards but no further action was taken.
The lead ebbed and flowed throughout the rest of the race but Hamilton did just enough, eking out his tyre life, to hold on for his 44th career victory, and undoubtedly one of his greatest.
He cut loose a little in the last 10 laps, setting fastest laps and building a bigger lead, to emphasise his control over the race.
The rain returned in the final three minutes of a race that ran to just under the two-hour time limit but to no ill effect.
Ricciardo was clearly distraught, saying over the radio at the end of the race: "Nothing you could say would make that any better. Save it."
It was the perfect result for Hamilton, his win and Rosberg's weak performance meaning he could make 19 points on his team-mate, which was badly needed after his difficult start to the season.
Renault's Jolyon Palmer crashed at the beginning of the race in wet conditions
It was a race to forget for the German, whose poor pace in the wet conditions lost him places not only to Hamilton but also, as the pit stops unfolded to Force India's Sergio Perez, Ferrari's Sebastian Vettel and McLaren's Fernando Alonso, who all drove excellent races.
When the pit stops were finished and the track was dry, Rosberg was right behind Alonso but was unable to pass the double world champion, despite his car's significant pace advantage.
Rosberg even dropped back from Alonso in the closing stages, and lost sixth place to Force India's Nico Hulkenberg.
Perez, who progressed to third from seventh on the grid thanks to strong driving around the first pit-stop period, held Vettel at arm's length once the track was dry to take the final podium position.
His task was aided by a mistake by Vettel when he ran wide and came oh-so-close to the Massenet barriers late in the race.
The Ferrari driver closed in again but, on another difficult weekend for a team whose aspirations to be a true threat to Mercedes are evaporating rapidly, had to be satisfied with fourth.
Alonso's fifth, an excellent effort under pressure from a much faster car, equalled his own best-ever result for the McLaren-Honda partnership since it re-started in 2015.
The Spaniard's team-mate Jenson Button finished ninth, while Renault's Jolyon Palmer crashed out heavily after losing control on the pit straight on the very first racing lap.
Man Utd midfielder Michael Carrick and Louis Tomlinson of One Direction visit Daniel Ricciardo in the garage