Red Bull's Max Verstappen took his second win of the year in a chaotic and incident-strewn German Grand Prix held in intermittent rain.
The Dutchman led a topsy-turvy result in which Ferrari's Sebastian Vettel took second from last on the grid and Toro Rosso's Daniil Kvyat was third.
Lewis Hamilton had a day to forget, finishing 11th after two mistakes.
But the Briton did not lose any ground to team-mate Valtteri Bottas in the championship after the Finn crashed.
It was a dismal way for Mercedes to end a weekend when the team celebrated 125 years in motorsport and their 200th Formula 1 race.
But the Mercedes drivers were not the only ones to fall foul of the treacherous conditions in a race that featured a remarkable six safety cars - two of them virtual - and the winner made five pit stops to change back and forth between wet and dry tyres.
Ferrari's Charles Leclerc crashed when looking in strong shape for at least second place. Renault's Nico Hulkenberg went off at the same place, the treacherous penultimate corner, which was also where Hamilton made one of his errors.
After the race Hamilton was classified as finishing ninth following 30-second penalties handed to the Alfa Romeos of Kimi Raikkonen and Antonio Giovinazzi for driver aid infringements. Hamilton therefore gained two points in the title race over Bottas. The action also ensured Williams scored an unlikely point for the first time this season, with Robert Kubica 10th.
Plenty of drivers came to grief on the slippery run-off area at the final corner. First Leclerc gets stuck, ironically, underneath a Mercedes advert...
But don't get too smug; Hamilton joined the fun soon afterwards...
... subsequently spending nearly one agonising minute in the pits having his car fixed - before being handed a penalty for enterign the pit lane dangerously
Verstappen supreme as Mercedes slip up
Through the chaos, Verstappen drove an almost flawless race, tracking the Mercedes in third place through the first half of the grand prix and then moving to the front as the world champions' race fell apart.
Red Bull made all the strategy calls correctly and Verstappen judged the conditions perfectly to take a well-deserved victory which made him look the class of the field - although even he had a big spin, one corner before the bend that took out Leclerc, Hulkenberg and Hamilton.
Mercedes' race began to unravel when Hamilton ran wide at the penultimate corner, slid across the slippery run-off and hit the wall.
Unlike Leclerc, who had gone off into the gravel the lap before when looking poised to take second place and was unable to get out of it, Hamilton did rejoin the track but with a damaged front wing.
Crazy racing: Who could have predicted this podium combination before lights out?
He pulled straight into the pits, breaking the rules by going the wrong side of a bollard, and then spent 50 seconds stationary as the Mercedes mechanics - who had been expecting Bottas to come in - mirrored an episode of Wacky Races as they ran about trying to replace his front wing and find the right set of tyres, bumping into one another along the way.
To make matters worse, the infringement with the bollard earned him a five-second penalty.
He rejoined the track in fifth place and after the restart soon passed Alexander Albon's well-driven Toro Rosso for fourth and then Hulkenberg's Renault for third.
But when Hulkenberg followed Leclerc and Hamilton into the wall after running wide at the second-last corner, there was another safety car, which went a long way to defining the finishing positions.
Verstappen pitted for fresh intermediate tyres but Mercedes did not, a decision Hamilton immediately questioned, the team saying they did not want to have to serve the penalty then, even though it seemed the obvious thing to do.
But shortly after the re-start on lap 46, with 18 laps to go, the track was drying and drivers pitted for dry-weather tyres. Mercedes left it a lap later for Hamilton than Verstappen and Bottas and he rejoined in 12th place.
He asked the team: "How did it go this bad?"
"Copy that, Lewis," he was told by his race engineer Peter Bonnington, who said they would look into it later.
Trying to make up lost ground, Hamilton then had a massive spin at Turn One with 11 laps to go, requiring him to stop again for fresh tyres.
It looked like he had gifted Bottas a great opportunity to make up some serious ground in the championship but then the Finn made his own mistake at the first corner four laps after Hamilton.
It was an error Bottas will probably rue for a very long time.
Before the chaos, Mercedes were decked out in '50s clothes to celebrate their 200th race in Formula 1 - complete with white-livered cars
Redemption for Vettel and Kvyat
At the opposite end of the scale, it was a remarkable day for Kvyat and Vettel - and redemption for both, in a way.
Vettel returned to the track where he crashed out of the lead last year and - after a quiet race spent largely in the lower reaches of the top 10 - came alive in the closing laps.
Fourth at the time of the final safety car following Bottas' crash, Vettel picked his way past McLaren's Carlos Sainz, Racing Point's Lance Stroll and Kvyat to take a superb second place.
Stroll and Kvyat had found themselves up in second and third after their teams decided to pit them towards the end of the safety car period for Hulkenberg's crash.
Kvyat, who has returned to F1 this season after being sacked by Red Bull at the end of 2017, passed Stroll to take second place but could not hold off Vettel's late charge.
"It was like a horror movie mixed with a black comedy," the Russian said - a quote that seemed to sum up the events of the day.
Stroll fell behind Vettel but still managed an excellent fourth place for the team now owned by his father, while Sainz took fifth - another excellent race drive from the Spaniard, who escaped his own off at the penultimate corner - and Albon a career-best finish of sixth halfway through his debut season.
The Anglo-Thai was unfortunate - he was well ahead of Kvyat all race and running consistently in the points, but lost out when his team gambled on Kvyat pitting under the key safety car, while they left Albon out because he was running fourth.
There was a treat for fans at Hockenheim as Mick Schumacher took his father Michael's championship-winning Ferrari F2004 around the circuit for a spin
Vettel's performance was a much-needed boost for Ferrari after a nightmare weekend.
Both cars went out of qualifying with engine problems, leaving Leclerc 10th on the grid and Vettel last.
Leclerc had made good progress in the opening laps and Ferrari's strategists had put him in a great position with perfect strategy calls in the first half of the race.
But he ran wide at the penultimate corner on lap 28, just after gambling on dry-weather tyres on a drying track. He got on to the slippery run-off, which seemed to be covered with a kind of film of soap, and slid into the gravel, his wheels spinning as he vainly fought to extricate himself.
"It was very slippery but the only thing I can say is I think it is unacceptable to have this kind of Tarmac. It is like a dragster track and once you go on it is very dangerous," Leclerc said.
"I take full responsibility for the mistake but I believe this kind of Tarmac shouldn't be on a Formula 1 track."
-- Courtesy of BBC Sport