Marc Marquez perfected a gamble to move from wet to slick tyres to take a dominant German Grand Prix victory and extend his MotoGP championship lead.
Rain fell steadily at the Sachsenring into the early afternoon of Sunday, and a brief shower half-an-hour before the race meant wet tyres were the obvious choice.
However a dry line emerged during the first half, as Danilo Petrucci led the way for Pramac Ducati, ahead of Andrea Dovizioso, Valentino Rossi, Jack Miller - who flew up from 16th on the grid - and Marquez.
Petrucci fell on lap 10, the same lap Marquez survived a wild off-track moment and dropped to eighth in the order.
The first pitstops started shortly afterwards, but with riders opting for either two intermediate tyres, or - in the case of Loris Baz - an intermediate front with a rear slick.
Ducati's Andrea Iannone opted for intermediates and spent the first few laps after his bike swap lapping several seconds off the pace of leader Dovizoso, who broke away from the lead pack slightly.
Marquez pitted on lap 17 and rolled the dice, fitting two slick tyres to match the drying circuit.
It was a masterstroke, and he began to take four, five and even six seconds per lap out of the riders at the front, quickly slashing what had been a deficit to the front of more than 30 seconds.
Dovizoso, Rossi, Cal Crutchlow - who stormed from 13th and had been the fastest rider on track in the middle of the race - Hector Barbera and Miller stayed out, despite their crews' best attempts to get them to pit.
Other than Miller, they eventually pitted together on lap 23, but it was too late.
Marquez swept into the lead and went on to win by 9.857 seconds.
With his third victory of the season, the Spaniard heads into the summer break leading the championship by 48 points over Jorge Lorenzo and Rossi by 59.
Lorenzo was an anonymous 15th and 77 seconds behind Marquez, struggling again in the wet conditions, while Rossi on intermediate tyres dropped to finish eighth, passed by Miller - who stopped after being passed by Marquez - on the final lap.
Crutchlow starred, picking up places at will to join the lead pack.
After his bike swap for slicks, he moved past Dovizioso and then Scott Redding in the closing laps to secure second place, equalling his best MotoGP result.
Redding was among the early pitters but took intermediate tyres, a move that looked set to pay off when he was running second to Marquez within sight of the flag.
But he was also passed by Dovizoso at Turn 12 on the last lap and had to settle for fourth, ahead of Iannone.
Dani Pedrosa was sixth, ahead of Miller, Rossi, Barbera and Alvaro Bautista.
Like the Assen race, Suzuki toiled in the rain, with Maverick Vinales finishing 12th and Aleix Espargaro 14th.
GERMAN GP RESULT
|2||Cal Crutchlow||LCR Honda||30||9.857s|
|4||Scott Redding||Pramac Ducati||30||11.992s|
|7||Jack Miller||Marc VDS Honda||30||26.043s|
|9||Hector Barbera||Avintia Ducati||30||26.614s|
|11||Eugene Laverty||Aspar Ducati||30||41.208s|
|13||Bradley Smith||Tech3 Yamaha||30||1m03.129s|
|16||Tito Rabat||Marc VDS Honda||29||1 Lap|
|17||Loris Baz||Avintia Ducati||28||2 Laps|
|18||Yonny Hernandez||Aspar Ducati||27||3 Laps|
|-||Pol Espargaro||Tech3 Yamaha||17||Retirement|
|-||Danilo Petrucci||Pramac Ducati||12||Retirement|