Marc Marquez sealed his sixth Moto2 pole position of the season with a last-gasp effort in mixed conditions at the Sachsenring.
As had been the case in MotoGP qualifying, track conditions started out wet but improved as the session developed, with several riders improving as the chequered flag flew.
Marquez was the prime example, the Monlau Suter rider jumping up to provisional pole with a 1m34.503s, putting him less than five hundredths of a second clear of Julian Simon's Avintia FTR.
Simon had been involved in a two-way fight for pole with Tech 3's Xavier Simeon until that moment. Simeon was in the hunt for pole when he fell on his final lap, ending his bid. As he did so, he was also demoted into fourth by Mika Kallio on the Marc VDS Kalex.
In contrast to Kallio, team-mate Scott Redding - on the podium in the past two races - suffered horribly in the conditions and will start Sunday's race from a season low of 26th.
Redding was not the only frontrunner to suffer. Andrea Iannone (Speed Master Speed Up), second to Marquez in the championship, wound up 10th, while Pol Espargaro (Pons Kalex), who has won twice this year, could only manage 17th.
Espargaro did well to hold onto a huge high-side moment in the final two minutes, one of several incidents during the session.
Gino Rea (Gresini Moriwaki) just beat Thomas Luthi (Paddock Suter) to fifth - 0.037s all there was to choose between the pair while Anthony West (QMMF Moriwaki) and Alex de Angelis (Forward Suter) rounded out the top eight.