Lewis Hamilton held off Max Verstappen, and survived a late collision with the Red Bull driver, to win a nail-biting Monaco Grand Prix.
The world champion was left struggling with the tyres on his Mercedes after fitting softer rubber than the Dutchman at pit stops during an early safety-car period.
Britain's Hamilton repeatedly complained that he was not going to be able to make the tyres last to the end but by careful management held on to take his fourth win of 2019.
Verstappen dropped from second on the road to fourth in the results because of a five-second penalty, promoting Ferrari's Sebastian Vettel to second and Mercedes' Valtteri Bottas to third.
Verstappen's punishment was for an unsafe release in the pits when all the leaders pitted on lap 12 as a safety car was deployed to clear up debris laid by Charles Leclerc's Ferrari.
Although Mercedes' run of consecutive victories at the start of this season continued, their sequence of one-twos is over as a result of Bottas' bad luck.
And Hamilton now holds a 17-point lead over his team-mate in the championship.
Hamilton went for fall back technique for his victory jump into the swimming pool
The defining moment of the race
Wearing a helmet painted in a design used by Niki Lauda, the Mercedes non-executive chairman who died on Monday, Hamilton was controlling the race, ahead of Bottas, Verstappen and Vettel, after converting his pole position into a lead a the first corner.
But the race came to life when Leclerc suffered a puncture when he spun trying to pass Nico Hulkenberg's Renault for 11th place on lap eight.
Leclerc had been making up ground after Ferrari's farcical strategic error in qualifying on Saturday meant he failed to progress beyond the first session.
The Monegasque had passed Romain Grosjean's Haas for 12th place with a brave move at Rascasse on the previous lap. He tried the same on Hulkenberg but the German left him less room.
They rounded the corner together but Leclerc's rear wheel caught the inside barrier, pitching him into a spin and puncturing the tyre.
He got going again, losing only two places, but his tyre began to deconstruct around the next lap and tore chunks out of his rear bodywork as he returned to the pits.
When the safety car was deployed, Hamilton led the leaders into the pits, as Bottas backed up Verstappen and Vettel to give Mercedes time to service both cars.
Red Bull pulled off a super-quick stop and released Verstappen into Bottas' path, and the two cars touched as the Finn was forced into the pit wall on the outside.
It gave Verstappen second place on the road, and caused Bottas a puncture that meant he had to stop again the next time around, losing a place to German Vettel. But ultimately it cost him more than it gained him - and he was given two penalty points on his licence as well as the time penalty.
Verstappen was handed a five-second time penalty for this impact with Bottas in the pitlane
Why was Hamilton struggling so much?
Hamilton's problem was that Mercedes had fitted medium tyres to his car, while Verstappen and Vettel were given hards - which Bottas was also switched to when he pitted for the second time.
It meant Hamilton had to do 66 laps on a set of mediums, when they were only projected to last 50.
It is unclear why Mercedes chose the medium, and the decision gave Hamilton a tough afternoon, spent controlling his pace and fending off Verstappen.
Passing is difficult at Monaco, but regardless it meant Hamilton could not afford to make a mistake despite fading grip, which was no easy task.
His concern was plain as he repeatedly complained over the radio that he was not going to make it and would not be able to hold Verstappen off.
At one point, he even said it was going to take a "miracle" to win it.
In the end, with about 10 laps to go, Mercedes' chief strategist James Vowles came on the radio and said: "You can make it if you trust it."
Verstappen went for it at the chicane with two laps to go, but he was too far back and locked a wheel, and they touched as Hamilton came across him.
Hamilton took to the escape road and carried on, as Verstappen complained: "He just turned in. I was trying to overtake."
That was the last drama and Hamilton hung on for the remaining two laps.
"You'll be alright mate." Cristiano Ronaldo paid a visit to Hamilton in the garages across the weekend
"Cristiano who?" Hamilton now has three Monaco wins to his name: drawing him level with old adversary Nico Rosberg, Stirling Moss and Jackie Stewart, second left, with five-time winner Graham Hill. Neither Britt Ekland or Peter Sellers have won at Monaco. Source: Forix
-- Courtesy of BBC Sport