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 victory came just three days after Mercedes had announced he had agreed a blockbuster two-year contract extension with the team and leapfrogged him 17 points ahead of Vettel in the championship.
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.
"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."
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.