Lewis Hamilton won his 100th Formula 1 race as a frantic last few laps in the Russian Grand Prix caused by heavy rain dashed Lando Norris' hopes of a maiden victory.
And the rain helped Hamilton's title rival Max Verstappen vault from seventh to second in his Red Bull after timing his change to wet tyres perfectly.
The Briton's win puts him back into the title lead but Verstappen's drive from the back of the grid in Sochi means Hamilton's advantage is only two points.
Hamilton already held the record for most F1 wins with Michael Schumacher next in the all-time list with 91 victories.
The late downpour turned the race on its head and while it gave the Mercedes driver a victory, it helped Verstappen even more.
McLaren's Norris, who took his maiden pole position on Saturday, was leading with five laps to go in his McLaren when it started to rain.
It was light initially and only over a few corners, but Verstappen, who was at that point struggling in seventh place, was one of the first drivers to pit for treaded intermediate tyres.
Norris also lost the lead on the first lapIt was the making of his afternoon as Norris and Hamilton - more than 30 seconds up the road in their battle for the lead - initially stayed out.
A similar decision briefly vaulted Alpine's Fernando Alonso, who was leading Verstappen in sixth place before the rain, to third.
Halfway around the lap following Verstappen's stop, Norris was asked if he wanted to stop for intermediate tyres and he said: "No."
Hamilton was also saying it was not raining that heavily, but was ordered to come in because more rain was coming.
He stopped a lap after Verstappen, with four to go, leaving Norris out in front on his slick tyres as the rain fell increasingly heavily.
Hamilton was 14.9 seconds behind Norris a lap after he had stopped, but the rain was by now so bad that the seven-time champion caught the McLaren within five more corners and swept by into the lead.
Norris finally stopped after tip-toeing around the rest of the lap but the delay in coming in for tyres dropped him down to seventh place at the end.
Ferrari's Carlos Sainz, who stopped for tyres at the same time as Verstappen, took third, while McLaren's Daniel Ricciardo and Mercedes' Valtteri Bottas also benefited from early stops for treaded tyres to take fourth and fifth ahead of Alonso.
Norris' gamble to stay on slick tyres cost him a first race winA terrible twist for Norris
The error of judgement by team and driver in the late rain was a bitter blow for Norris after appearing on course for an impressive maiden victory for so long.
The 21-year-old lost the lead to Sainz at the start and tracked the Ferrari for 13 laps before re-passing for the lead.
Hamilton, meanwhile, had dropped from fourth on the grid to seventh on the first lap and he spent the first part of the race stuck in a train behind Williams driver George Russell in third, who was ahead of Aston Martin's Lance Stroll and Ricciardo.
When Russell and Stroll pitted out of the way, Ricciardo appeared to be holding Hamilton back to give Norris some breathing space at the front.
At the same time Verstappen had made excellent progress from his place on the back row of the grid following an engine penalty and was only two seconds behind Hamilton - with team-mate Sergio Perez and Alonso between them - after just 20 laps.
After both Norris and Hamilton had pitted, Norris had a 10-second lead, which the Mercedes driver remorselessly closed.
But with 10 laps to go, Norris appeared to be in control, with Hamilton not able to get within a second of him, only for the rain to change everything.
Ferrari's Charles Leclerc was another to suffer for a late decision to change tyres.
Starting from the back of the grid, he was ninth heading into the closing laps, two spots behind Verstappen, and was briefly up to fourth as the rain threw everything up in the air.
But stopping late on the same lap as Norris meant he dropped down out of the points into 15th.
Max Verstappen came from last on the grid for a second place finishedA lucky break for Verstappen
A decision to stop for fresh tyres on lap 26 - about half-distance - appeared to have been damaging for Verstappen.
It dropped him behind a slow-moving pack of cars and he lost ground to the leaders. And things went from bad to worse when Alonso - who had also started on hards, but stopped 10 laps later for fresh tyres - passed him into Turn Two, Verstappen seemingly unable to do anything about reclaiming sixth place.
Verstappen said that both situations were caused by the fact his tyres were worn out after spending so long in traffic.
But the rain came to his rescue. He made the call to stop for intermediate tyres at exactly the right time and was able to vault up into second, in what could be a critical move in a championship battle that is so close.
Driver of the day
Really hard to call this one. Norris, Hamilton, Verstappen and Alonso were probably the picks of the field, but let's give it to Norris for controlling the race so well for so long after re-passing Sainz, even if he and McLaren did bungle the late tyre choiceWhat happens next?
A two-week gap until the Turkish Grand Prix. Last year's race was a chaotic rain-hit affair in which Hamilton put in one of his greatest drives to win the title. But this year, it is far too close to make any pre-race predictions.