Vinales, Marquez on pole in Germany
Maverick Vinales took his third pole position of the 125cc season at the Sachsenring, while Marc Marquez denied his title rival Stefan Bradl a home pole position in Moto2 qualifying.
After running outside the top 10 at first, Marquez surged to the front and then held off a late challenge from Bradl with a 1m24.733s lap - 0.129 seconds ahead of the points leader.
Aleix Espargaro (Pons) sat on provisional pole for a spell before ending up third, ahead of Gresini's Michele Pirro.
Julian Simon announced his return after breaking his leg at Catalunya with a superb fifth place on the grid on the Aspar Suter.
Home rider Max Neukirchner looked set to fight for pole for a while for MZ, before sliding to 11th as others improved.
Practice pacesetter Yuki Takahashi crashed early and had to miss most of the session, leaving him 13th.
Other incidents included a massive crash for Jules Cluzel, who immediately got up but required assistance from the marshals while in the gravel, and a late fall for Bradley Smith. The Briton had managed to keep upright through a wild gravel trip early in the session, but was not so successful when he went off again on his final lap.
Rising Spanish star Vinales put in a 1m27.477s to come out on top of a tough battle with Aspar's Hector Faubel, who then somehow managed to stay upright and on the bike during a wild high-speed ride through the gravel as he tried to respond.
The rapidly-improving Luis Salom maintained his recent strong form to put the RW Aprilia on the final front row spot.
Championship leader Nico Terol (Aspar) was back in fourth, alongside Sergio Gadea, who recovered well from a suspension issue that delayed the start to his session, and Johann Zarco.
Moto2 qualifying result:
1. Marc Marquez (Spain) Suter 1:24.733
2. Stefan Bradl (Germany) Kalex 1:24.862
3. Aleix Espargaro (Spain) Pons Kalex 1:24.900
4. Michele Pirro (Italy) Moriwaki 1:25.085
5. Julian Simon (Spain) Suter 1:25.189
6. Alex de Angelis (San Marino) Motobi 1:25.223
7. Xavier Simeon (Belgium) Tech 3 1:25.235
8. Mika Kallio (Finland) Suter 1:25.271
9. Bradley Smith (Britain) Tech 3 1:25.304
10. Yonny Hernandez (Colombia) FTR 1:25.310
125cc qualifying result:
1. Maverick Vinales (Spain) Aprilia 1min 27.477secs
2. Hector Faubel (Spain) Aprilia 1:27.808
3. Luis Salom (Spain) Aprilia 1:27.865
4. Nicolas Terol (Spain) Aprilia 1:27.992
5. Sergio Gadea (Spain) Aprilia 1:28.067
6. Johann Zarco (France) Derbi 1:28.178
7. Efren Vazquez (Spain) Derbi 1:28.316
8. Alberto Moncayo (Spain) Aprilia 1:28.344
9. Jonas Folger (Germany) Aprilia 1:28.390
10. Danny Kent (Britain) Aprilia 1:28.626