MONTE CARLO -- Red Bull's Sergio Perez claimed victory at a wild Monaco Grand Prix on Sunday as Ferrari spectacularly threw victory away.
Just one week on from being denied victory at the Spanish Grand Prix after obeying a team order to give the lead to teammate Max Verstappen, Perez turned in a superb drive in changing conditions to claim the third win of his Formula One career at the championship's most famous race.
Perez held off pressure from Ferrari's Carlos Sainz, who finished just over one second behind, with Verstappen and Charles Leclerc both finishing within three seconds of victory at the finish.
Ferrari had started with Leclerc and Sainz on the front row and looked like the favourite to win the race. Leclerc's hopes of winning his home race fell apart in spectacular fashion as Ferrari blundered on strategy, before another mistake cost him the chance of even being on the podium.
The win has moved Perez to within 15 points of Verstappen in the driver's championship and has underlined his credentials as a contender for this year's title.
Verstappen still leads the championship with 125 points, nine up on Leclerc.
It was a dramatic race that involved two red flags and a 70-minute delay due to a heavy downpour before the race. The rain would prove to be a decisive factor in the outcome.
Perez's victory hinged on his early call to switch from the full wet tyre to the intermediate on Lap 17, two laps before Ferrari did the same thing with race leader Leclerc.
In those two laps, Perez found the pace to cut the gap to Leclerc, known as the "undercut" in F1, and when the Ferrari driver emerged from his own stop, he did so behind the Red Bull driver on what is the most difficult circuit for overtaking on the calendar.
In the other Ferrari, Sainz had successfully argued against making the same switch, and he dragged his first stint out until Lap 22, when he swapped his full wet tyre for a dry tyre.
In what might go down as one of the biggest blunders of Ferrari's recent history, the team also called Leclerc in to pit for dry tyres at the same time, only to scream at him to stay out once he had already made the dive into the pit entry on the final corner.
It was a radio exchange that is likely to haunt Leclerc and Ferrari for as long as he is unable to win this famous race.
Leclerc's engineer said: "Box now, box now, box now, box now ..."
As Leclerc turned into the pit entry at the final corner, that request changed to: "Stay out! Stay out! Stay out!"
It was too late for Leclerc to change course and his visor cam showed him waving his hand around wildly.
Leclerc's radio message was censored by F1.
"Why, why, what are you [expletive] doing!?"
Leclerc, who came into the weekend laughing off questions about a curse at his home race, dropped behind Verstappen to fourth, where he would remain until the end of the race.
It is the second successive year Leclerc has failed to convert pole position into a victory or podium at Monaco.
After the race, Leclerc said to Ferrari: "No words. We cannot do that. We cannot do that."
Mercedes' George Russell continued his remarkable consistency, finishing a distant fifth.
McLaren's Lando Norris, who claimed the fastest lap of the race, was sixth and spent much of the final stint of the race asking for permission to attack Russell on the road.
Alpine's Fernando Alonso finished 34 seconds behind Norris and spent much of the race backing a frustrated Lewis Hamilton towards Esteban Ocon, in the other Alpine. Hamilton and Ocon had clashed at Turn 1 midway through the race, for which Ocon was given a five-second penalty.
After Hamilton realised he would not get past Alonso on the tight and twisty Monte Carlo circuit, he slowed to back Ocon out of the points, with Valtteri Bottas, Sebastian Vettel and Pierre Gasly all finishing within five seconds of Ocon.
Once the penalty was applied after the finish, Ocon was down in 13th.
The race restarted at 16:10 local time following a 70-minute delay, when the rain had stopped but the track was still wet, with all drivers starting on the full wet tyre.
The race was red-flagged for a second time when Haas' Mick Schumacher crashed at the second Swimming Pool chicane on Lap 27.
Schumacher had been battling Alfa Romeo rookie Guanyu Zhou for 16th when he lost control on the exit of the first chicane and hit the inside wall at 16:47 local time. The momentum of his car then carried him straight on and into the barriers.
The crash will continue to ramp up the pressure on Schumacher, who has still yet to score a point in Formula One.
While the crash looked fairly innocuous, the rear suspension and rear wing were completely detached from the rest of the Haas car.
Curiously, the race stewards cycled through all three of the options available to them in the case of a crash as marshals looked to clear the wreckage.
First, they implemented the virtual safety car, in which drivers are required to drive slowly to a delta time.
The actual safety car was then deployed two minutes later, which requires the field to bottle up behind a pace car.
Six minutes later, the race was suspended with a red flag to allow marshals to fix the barrier Schumacher had gone into.
The race resumed at 17:17 local time and continued without a stoppage.