Lewis Hamilton charged from 14th on the grid to claim victory in a dramatic German Grand Prix on Sunday to reclaim the lead of the Formula 1 drivers' championship as rain turned the race on its head, with title rival Sebastian Vettel crashing out while leading.

Hamilton started 14th after a hydraulic failure on his car sidelined him during qualifying on Saturday, but the Briton was able to fight his way up the order to run fifth after just 14 laps, albeit running more than 20 seconds off the leading drivers.

German GP Records

Starting from pole, Vettel had managed to retain his advantage early on before losing a place to Ferrari teammate Kimi Raikkonen after the Finn made an early pit stop and got the undercut, only for the team to swap the drivers on-track due to their varying strategies.

A short, sharp rain shower hit Hockenheim with 20 laps to go, leaving the pit walls to consider a switch to intermediate tyres. Most of the front-runners tried to stay out on the dry compounds, with Hamilton managing to close in thanks to his fresh Ultrasofts, finding plenty of time through the spray.

Vettel was looking comfortable in the lead of the race with an eight-second buffer over the field, only for his hopes of a first victory at Hockenheim to end with 25 laps to go, sliding off the track and into the wall at Turn 13. Vettel thumped his steering wheel in anger before apologising to Ferrari over the radio, having thrown away a shot at victory.

Vettel's off resulted in a Safety Car period, with both Mercedes and Ferrari opting to fit new tyres to their lead drivers. While Raikkonen and Bottas both came in for Ultrasofts as the rain faded, Hamilton bailed out of a pit stop at the last possible moment amid indecision on the Mercedes pit wall, staying out on tyres that were already 11 laps old.

With fresher, warmer rubber, Bottas - now running second after passing Raikkonen through the spray - was able to immediately attack Hamilton on the restart, with the pair going side-by-side through Turn 8. Hamilton refused to back down, holding firm in the lead, with Bottas dropping back after a small error.

Bottas was left occupied with Raikkonen in the battle for second, prompting Mercedes to tell their driver to "hold position" and not attempt to catch Hamilton, leaving the Briton to charge to a stunning victory, 4.5 seconds clear of the field.

The result sees Hamilton pull out a 17-point lead at the top of the drivers' championship over Vettel, who was left to digest his first retirement of the season after a mistake that could prove costly come the end of the season.

Bottas held Raikkonen back to complete a first one-two finish for Mercedes at the circuit, putting the team back in the lead of the constructors' championship with an eight-point buffer heading to the Hungarian Grand Prix next Sunday. Raikkonen recorded his seventh podium finish of the season in third for Ferrari, salvaging some points for the team on a tough day.

Max Verstappen bounced back from two additional stops - having switched to intermediates and then back to dry tyres before the worst of the rain shower - to take fourth for Red Bull, leading its charge after teammate Daniel Ricciardo was forced to retire early on after a loss of power.

Nico Hulkenberg managed to lead the midfield fight for Renault in fifth ahead of Haas driver Romain Grosjean, with both gambling on intermediates before re-fitting Ultrasofts in the closing stages.

Sergio Perez and Esteban Ocon gave Force India a double-points finish in seventh and eighth, having both stayed out on Softs despite the rain. Marcus Ericsson also benefitted from the late drama to rise to ninth for Sauber, matching his best result of the season, while Brendon Hartley scored his second F1 point by taking 10th for Toro Rosso.

Kevin Magnussen lost out in the final stages after switching from intermediates to dry tyres, while Carlos Sainz Jr. was demoted from 10th on-track to 12th in the final classification after receiving a penalty for overtaking under the Safety Car. Stoffel Vandoorne recovered from a mid-race issue to finish 13th, while Pierre Gasly and Charles Leclerc were the last classified finishes in 14th and 15th, both pitting too early for wet tyres before switching back to drys for when the rain was at its heaviest.

Fernando Alonso retired from the race with two laps remaining, joining both Williams drivers on the sidelines, with Lance Stroll and Sergey Sirotkin retiring within two laps of each other.