Max Verstappen mastered both wet and dry conditions to win the 2019 Formula 1 German Grand Prix for Red Bull as Mercedes faltered.
Rain before the start and during the race made for an incident-packed event in which polesitter Lewis Hamilton spun twice on his way to an eventual 11th place, and his Mercedes teammate Valtteri Bottas crashed out.
Ferrari's Sebastian Vettel raced from the back of the grid to finish second, but it was a mixed day for the Scuderia after Charles Leclerc spun into retirement.
Daniil Kvyat was third thanks to astute tactical manoeuvrings by Toro Rosso.
Torrential rain throughout the morning ensured this would be the first test of the revised wet-weather starting procedures introduced in F1 in 2017, with the safety car leading the pack for several formation laps.
Predictably, a number of the more combative-minded drivers began to lobby for the safety car to be withdrawn so the race could begin, and it duly peeled off after several additional formation laps to enable a standing start.
Hamilton seamlessly converted pole into the race lead as Verstappen squandered his front-row start with too much wheelspin, conceding two places as both Bottas and Alfa Romeo's Kimi Raikkonen went by.
He almost lost a further place to the fast-starting Haas of Romain Grosjean, too, but reasserted himself into Turn 1 and recovered third place from Raikkonen next time around.
Spray and uncertain grip levels precipitated chaos in their wake as Carlos Sainz's McLaren ran wide in Turn 2 and Nico Hulkenberg and Leclerc pounced, and the midfielders bumped and banged their way through the opening laps.
At the end of the second lap Sergio Perez rotated his Racing Point into the barrier at the exit of Turn 11, bringing out the safety car.
Vettel - starting from the back of the grid after failing to run in qualifying - and Toro Rosso's Alex Albon dived straight into the pits for intermediates while Hamilton and the rest of the frontrunners had to complete another lap before doing likewise.
A handful of teams gambled on leaving drivers out on the full wet tyres but that soon proved to have been the wrong option as a dry line began to form.
Kevin Magnussen was one such and, although he was running second behind Hamilton in the safety car queue, he was quickly swamped by Bottas and Verstappen when the race was green-flagged on lap 4.
Stopping a lap earlier elevated Vettel to 12th and he quickly cut through the midfielders ahead to run seventh behind Hamilton, Bottas, Verstappen, Leclerc, Nico Hulkenberg and Raikkonen. But he was still over half a minute behind Hamilton, who remained serene in the rapidly changing conditions, stretching his advantage over Bottas beyond five seconds.
Leclerc and Hulkenberg stopped early for new intermediates, on lap 15, and predictably the Ferrari left the Renault blowing in the wind as they rejoined.
By lap 22 Leclerc had closed the gap to Verstappen to below four seconds, leaving Hulkenberg 20s down the road, though the threat to him from Raikkonen and Vettel was diminished by their worn intermediates.
On lap 23 Vettel pitted for slicks, taking on the soft compound, signalling that Ferrari at least believed track conditions had passed the crossover point, even though the start/finish straight was still covered in a film of water. Red Bull brought Verstappen in from third place a lap later and fitted mediums.
Mercedes opted to fit mediums as well when it pitted Bottas on lap 26, while Ferrari went for softs on Leclerc's car on the following lap. Hamilton was next in, for mediums, but his arrival in the pits coincided with a fresh downpour unheralded on the weather radar.
Leclerc immediately aquaplaned off at T17, beaching himself in the gravel and bringing out the safety car, and then Hamilton speared off-track at the same point on the following lap.
Hamilton managed to gather his Mercedes into line and just glanced the barrier, breaking his front wing, but he was able to head straight into the pits.
There chaotic scenes ensued as his unprepared crew fumbled for a new set of intermediate tyres and a replacement front wing, and to heap further misfortune on Hamilton's plate he was hit with a five-second penalty for driving on the wrong side of the pit-entry bollard.
The rest of the field then pitted for intermediates as it became obvious that the slicks were unsuitable, leaving Verstappen in the lead ahead of Bottas, Hulkenberg, Albon, Hamilton, Sainz, Raikkonen and Vettel.
Hamilton made short work of Albon in green-flag conditions as Hulkenberg pressured Bottas, handing Verstappen the opportunity to break nearly 10 seconds clear.
That enabled Verstappen to gain a free pitstop for fresh intermediates when the safety car came out again on lap 40, triggered when Hulkenberg went off at Turn 17 shortly after being passed by Hamilton for third.
The track began to dry again as the field circulated behind the safety car for four laps, prompting Racing Point to gamble by pitting the hitherto anonymous Lance Stroll for slicks the lap before the green flag, followed by Kvyat.
This dropped them to the tail of the field, but after the other runners also broke for the pits after the track had gone live, the duo benefitted to run second and third behind Verstappen.
Kvyat used DRS to pass Stroll on the run to the hairpin on lap 50, while Mercedes' day went from bad to worse as Hamilton spun down to 15th place and then Bottas gyrated into the barrier at Turn 1 on lap 56, signalling yet more work for Bernd Maylander in what was proving to be a busy day at the office for the safety car pilot.
With five laps to run the track went green again with Verstappen leading from Kvyat and Stroll, while Vettel relieved Sainz of fourth immediately after the restart.
Two laps later Vettel blasted by Stroll on the straight before the hairpin, and he nailed Kvyat next time round to annex second place in the final reckoning, crossing the lap 7.3s seconds behind the victorious Verstappen.
Stroll survived late attention from Sainz to retain fourth, while Albon made it to the flag ahead of Raikkonen and Antonio Giovinazzi despite a tag from Gasly that sent the second Red Bull into retirement.
Grosjean and Magnussen rounded out the top 10, though bonhomie was likely to be in short supply in the Haas camp since they contrived to collide once again in the closing laps, this time without eliminating each other.