Alpine's Esteban Ocon took a maiden Formula 1 victory in an extraordinary and madcap Hungarian Grand Prix.
Lewis Hamilton regained the World Championship lead for the first time since May after fighting back to finish third having been last five laps into the race.
His title rival Max Verstappen was a victim of an incident-strewn wet start but managed to salvage a point for 10th place in a badly damaged Red Bull.
A race featuring an opening first few laps among the most remarkable in Formula 1 history left Hamilton with a six-point lead over Verstappen as the sport goes into its three-week summer break.
Hamilton finished a close third behind Ocon and Sebastian Vettel's Aston Martin, but the German was later disqualified for a fuel irregularity. He was left in second in the final results, pending an appeal by his team against the verdict.
A pile-up at the first corner on a slippery track left Hamilton briefly leading Ocon and Vettel on the first lap before the race was red-flagged to clear up the mess strewn over the track.
Extraordinarily, when the race restarted, Hamilton was the only car on the grid for a second start as every other driver made pit stops for dry-weather slick tyres because the sun had come out and the track was almost dry.
Hamilton had to stop at the end of the next lap, dropping to the tail of the field, leaving Ocon to fend off Vettel for the rest of the race.
Vettel tried to pass a number of times, but Ocon - a former Mercedes young driver - held on for the entire 70 laps to take a superb first win.
Ocon's team-mate Fernando Alonso played an important role in securing the win for the Frenchman, defending valiantly against Hamilton for 10 laps in the closing stages.
Hamilton, having fought his way back up to fourth from last, made a pit stop with 23 laps to go to fit fresh tyres and make a bold bid for victory.
The Mercedes driver had the pace to make it happen and might have done, had Alonso not held him off for lap after lap with a display of tough racecraft, a couple of times just on the edge of acceptability.
After Hamilton finally got past Alonso with five laps to go, he passed Ferrari's Carlos Sainz two laps later and charged up to the front two, finishing just 0.8secs behind Vettel, with Sainz fourth and Alonso fifth.
After the race, Hamilton went to see the Mercedes doctor because he was suffering from fatigue and dizziness. He said in the news conference later that he had been struggling with his fitness all year after contracting Covid-19 last December.
What happened at the start?
A race that will go down as one of the most remarkable ever seen was gripping from start to finish, and the action was caused by rain which started about half an hour before the race.
At the start on a wet track, Hamilton's team-mate Valtteri Bottas misjudged his braking point and cannoned into McLaren's Lando Norris, who was pushed into Verstappen. Bottas also then took out the second Red Bull of Sergio Perez.
The Finn has been given a five-place grid penalty at the next race in Belgium on the last weekend in August.
Ferrari's Charles Leclerc was briefly looking at second place behind Hamilton, only for Aston Martin's Lance Stroll to make a mistake, brake too late, slide onto the grass and smash into the Ferrari, which then tipped McLaren's Daniel Ricciardo into a spin.
With debris all over the track, the red flag was thrown and the cars returned to the pits, where Red Bull set about trying to repair Verstappen's car.
The damage was extensive, with chunks missing from the floor and his entire right-hand barge-board gone, causing significant amounts of lost downforce.
Verstappen took the restart in 13th place and was faced with a long afternoon battling a car with no balance and lacking a lot of grip. But he fought valiantly and managed to separate Ricciardo from the final points place in the closing stages.
How did Hamilton end up last from the lead?
By the time the race restarted, the rain had stopped and the sun was out, but all the drivers were on intermediate tyres when they set off on the formation lap for another standing start.
Hamilton was telling his team the track was ready for slicks but he did not come in - whereas everyone else did. That created the surreal - and unprecedented - sight of just one car on the grid for the start of the race.
The extra pace the slick tyres gave the rest of the field meant when Hamilton pitted for his own slicks next time around, he was shunted to the back in 14th place after six cars had retired. The question became how much ground he could recover on a track on which overtaking is notoriously difficult.
He had made three places when he pitted on lap 19 for fresh tyres, the idea being to run in clear air and then make up places on those on older tyres in front of him.
By lap 46, Hamilton was up to fourth place behind Ocon, Vettel and Sainz when he pitted again for fresh tyres.
The move dropped him a further place behind Alonso, but the hope was he could pass all the cars in front to take an unlikely win.
But Alonso, who was showing strong pace himself and had closed up to the back of Sainz, had other ideas, and in one of the greatest displays of defensive driving for years held off the much faster Mercedes for 10 nail-biting laps, before he ran a little too deep into Turn One with five laps to go, giving Hamilton the chance to pass into Turn Two.
What about the winner?
Ocon led the race from Hamilton's first stop and he and Vettel were able to make a break at the front, building a 15-second lead, as the rest of the field were held up by Williams' Nicholas Latifi in third place for the first 22 laps.
Vettel had more pace, but Ocon drove with great maturity to fend off the German for the entire race.
A slow pit stop by Vettel and Aston Martin mid-race gave Ocon breathing space to come in next time around without too much pressure and retain the lead.
In the remaining laps, Vettel got close on a couple of occasions but Ocon was always just out of reach and held on for his first win.
It was the team's first victory in its new guise of Alpine and the first since Kimi Raikkonen won the 2013 Australian Grand Prix, when they were known as Lotus.
Further down the order, Latifi and Briton George Russell scored their first points for the Williams team in eighth and ninth places, which became seventh and eighth with Vettel's disqualification.
Driver of the day
What happens next?
A three-week break before the season reconvenes at the magnificent Spa-Francorchamps circuit for the Belgian Grand Prix.
- The man who introduced Joe Wicks to meditation: Exploring spirituality and mindfulness with Russell Brand
- The Ancient Olympics: You're Dead To Me explores how even death couldn't stop you winning