Lewis Hamilton beat Sebastian Vettel in the German Grand Prix pole fight, as his Mercedes team-mate Nico Rosberg did not even make Q3.
In a close fight at the end of the session, Hamilton produced a 1m29.398s to beat Vettel's Red Bull to the top spot by 0.103 seconds.
Hamilton had held provisional pole on a 1m29.540s after the first Q3 runs, with Vettel going 0.039s quicker before the Mercedes responded and beat him.
Mercedes appeared to make a simple miscalculation with Rosberg, believing his early Q2 time - good enough for second when it was set - would be sufficient.
But the second half of the field was shaken right up when nearly everyone improved in final seconds, and as the likes of Jenson Button, Daniel Ricciardo and Nico Hulkenberg squeezed into the top 10, Rosberg was pushed out.
Mark Webber put the second Red Bull third, ahead of Lotus pair Kimi Raikkonen and Romain Grosjean.
Ricciardo - whose Toro Rosso team-mate Jean-Eric Vergne was only 16th - continued his excellent qualifying form with sixth.
Ferrari opted out of the pole fight. Felipe Massa and Fernando Alonso ran medium tyres in Q3 rather than the faster softs and ended up on row four.
McLaren's Button followed the same tactic in ninth and did not do a Q3 flying lap. Hulkenberg reached Q3 for Sauber and followed suit.
Neither Force India reached Q2, with Paul di Resta 12th and Adrian Sutil a very disappointing 15th at home.
Sergio Perez looked in danger of getting knocked out in Q1 at one stage, so his eventual 13th place was not as bad as it might have been. His McLaren will share row seven with compatriot Esteban Gutierrez's Sauber.
Williams joined Caterham and Marussia in the bottom six.
Pos Driver Team Time Gap
1. Lewis Hamilton Mercedes 1m29.398s
2. Sebastian Vettel Red Bull-Renault 1m29.501s +0.103s
3. Mark Webber Red Bull-Renault 1m29.608s +0.210s
4. Kimi Raikkonen Lotus-Renault 1m29.892s +0.494s
5. Romain Grosjean Lotus-Renault 1m29.959s +0.561s
6. Daniel Ricciardo Toro Rosso-Ferrari 1m30.528s +1.130s
7. Felipe Massa Ferrari 1m31.126s +1.728s
8. Fernando Alonso Ferrari 1m31.209s +1.811s
9. Jenson Button McLaren-Mercedes No time set
10. Nico Hulkenberg Sauber-Ferrari No time set
Q2 cut-off time: 1m30.269s Gap **
11. Nico Rosberg Mercedes 1m30.326s +0.501s
12. Paul di Resta Force India-Mercedes 1m30.697s +0.872s
13. Sergio Perez McLaren-Mercedes 1m30.933s +1.108s
14. Esteban Gutierrez Sauber-Ferrari 1m31.010s +1.185s
15. Adrian Sutil Force India-Mercedes 1m31.010s +1.185s
16. Jean-Eric Vergne Toro Rosso-Ferrari 1m31.104s +1.279s
Q1 cut-off time: 1m31.681s Gap *
17. Valtteri Bottas Williams-Renault 1m31.693s +1.146s
18. Pastor Maldonado Williams-Renault 1m31.707s +1.160s
19. Charles Pic Caterham-Renault 1m32.937s +2.390s
20. Jules Bianchi Marussia-Cosworth 1m33.063s +2.516s
21. Giedo van der Garde Caterham-Renault 1m33.734s +3.187s
22. Max Chilton Marussia-Cosworth 1m34.098s +3.551s
107% time: 1m36.885s
* Gap to quickest in Q1
** Gap to quickest in Q2