Hockenheim - Lewis Hamilton regained the lead in the world drivers' championship on Sunday when he claimed one of the most memorable victories of his career by winning a rain-hit German Grand Prix for Mercedes after starting from 14th on the grid.
The defending four-time champion took full advantage of a heavy downpour during which title rival and fellow-four-time champion Sebastian Vettel of Ferrari crashed out of contention to produce a master-class of technical and tactical racing in treacherous conditions.
His team-mate Valtteri Bottas came home second, 4.5 seconds behind the Englishman, ahead of fellow-Finn Kimi Raikkonen of Ferrari to deliver Mercedes' first one-two finish at a German Grand Prix.
It was Hamilton's fourth win this year and the 66th of his career, the triumph lifting him to the top of the drivers' title race and putting Mercedes back on top of the constructors' championship - no wonder Mercedes chairman Dieter Zetsche embraced him.
"Get in there, Lewis," said Mercedes on team radio. "Miracles do happen mate." Hamilton said: "What an amazing job by you guys. Love conquers all."
"That was highly unlikely, but you've got to believe," Hamilton added. "I said a long prayer before the start...I kept pushing, kept believing and I manifested my dream. So, thanks to God."
Dutchman Max Verstappen finished fourth for Red Bull ahead of German Nico Hulkenberg of Renault, Romain Grosjean of Haas, Sergio Perez and his Force India team-mate Esteban Ocon.
Marcus Ericsson was ninth for Sauber and New Zealander Brendon Hartley 10th for Toro Rosso.
The race began in sweltering conditions with an air temperature of 27 degrees Celsius, or 80 Fahrenheit, and the track at 43 with humidity at 50 per cent and rainclouds looming all around.
Vettel made a clean start from his 55th pole position and resisted Bottas as Raikkonen fought off Verstappen, but most attention was on Hamilton.
The Englishman was swiftly up to 12th from 14th and then reeled off a series of measured passes to climb to sixth by lap 11, when he passed Hulkenberg.
At the front, Vettel was content to stay 3.8 seconds clear of the chasing Bottas before Raikkonen was first to pit, on lap 15, switching to softs and rejoining fourth.
Ricciardo, who had started at the back of the grid, climbed as high as sixth before engine failure on lap 29 ended his race.
A series of pit stops saw the lead pass from Vettel to Bottas to Verstappen and finally to Raikkonen, at which point Vettel was second.
With dark clouds swirling around, Mercedes told Hamilton they were extending his first stint "as much as we can."
Vettel, trapped behind Raikkonen, complained to his team.
"This is just silly - I'm losing time and destroying my tyres," he told Ferrari. "I'm losing everything I got in the first stint."
Eventually, the team asked the Finn to allow Vettel to retake the lead.
Hamilton, finally, pitted for ultra-soft tyres on lap 43 - Mercedes guessing that the rain would not be too heavy - and rejoined in fifth.
"You'll have the best chance on this tyre, you've got the best rubber," they told Hamilton.
When the patchy rain started it created mayhem, Vettel losing part of his front wing after hitting a kerb, but hanging on in the lead ahead of Raikkonen.
Hamilton then reported heavier rain as Bottas passed his fellow-Finn for second.
After 52 laps, Vettel crashed, sliding straight into the barriers.
A safety car came out and while his rivals pitted for fresh tyres, Hamilton inherited lead, albeit with tyres 10 laps old.
When racing resumed on lap 57, Bottas attacking his Mercedes team-mate, but Hamilton held on.
On lap 60, Hamilton posted a near-phenomenal lap in 1:15.7, nine-tenths quicker than Bottas.
"Valtteri, it's James, please hold position, I'm sorry," Mercedes strategist James Vowles told Bottas. "Copy, James," he replied.
German Grand Prix results at Hockenheim on Sunday:
1. Lewis Hamilton (GBR/Mercedes) 1hr 32min 29.845, 2. Valtteri Bottas (FIN/Mercedes) at 4.535, 3. Kimi Raikkonen (FIN/Ferrari) 6.732, 4. Max Verstappen (NED/Red Bull-Renault) 7.654, 5. Nico Hlkenberg (GER/Renault) 26.609, 6. Romain Grosjean (FRA/Haas-Ferrari) 28.871, 7. Sergio Prez (MEX/Force India-Mercedes) 30.556, 8. Esteban Ocon (FRA/Force India-Mercedes) 31.750, 9. Marcus Ericsson (SWE/Sauber-Ferrari) 32.362, 10. Brendon Hartley (NZL/Toro Rosso-Honda) 34.197, 11. Kevin Magnussen (DEN/Haas-Ferrari) 34.919, 12. Carlos Sainz Jr (ESP/Renault) 43.069, 13. Stoffel Vandoorne (BEL/McLaren-Renault) 46.617, 14. Pierre Gasly (FRA/Toro Rosso-Honda) 1 lap, 15. Charles Leclerc (MON/Sauber-Ferrari) 1 lap, 16. Fernando Alonso (ESP/McLaren-Renault) 1 lap
Daniel Ricciardo (AUS/Red Bull-Renault), Sergey Sirotkin (RUS/Williams), Sebastian Vettel (GER/Ferrari), Lance Stroll (CAN/Williams), Fernando Alonso (ESP/McLaren-Renault)
World championship standings:
1. Lewis Hamilton (GBR) 188 pts, 2. Sebastian Vettel (GER) 171, 3. Kimi Rikknen (FIN) 131, 4. Valtteri Bottas (FIN) 122, 5. Daniel Ricciardo (AUS) 106, 6. Max Verstappen (NED) 105, 7. Nico Hulkenberg (GER) 52, 8. Fernando Alonso (ESP) 40, 9. Kevin Magnussen (DEN) 39, 10. Sergio Perez (MEX) 30, 11. Esteban Ocon (FRA) 29, 12. Carlos Sainz Jr (ESP) 28, 13. Romain Grosjean (FRA) 20, 14. Pierre Gasly (FRA) 18, 15. Charles Leclerc (MON) 13, 16. Stoffel Vandoorne (BEL) 8, 17. Marcus Ericsson (SWE) 5, 18. Lance Stroll (CAN) 4, 19. Brendon Hartley (NZL) 2
1. Mercedes 310 pts, 2. Ferrari 302, 3. Red Bull 211, 4. Renault 80, 5. Force India 59, 6. Haas 59, 7. McLaren-Renault 48, 8. Toro Rosso-Honda 20, 9. Sauber 18, 10. Williams 4