Fernando Alonso secured his second straight pole position as German Grand Prix qualifying at Hockenheim became a last-minute scramble on a wet track.
The 10 drivers in the pole shoot-out were all delivering quicker and quicker times as they acclimatised to the circuit conditions in the final moments, and it was Alonso who handled it best, putting in a 1m40.621s to take pole for Ferrari.
World champion and local hero Sebastian Vettel was Alonso's nearest challenger, lapping 0.4 seconds slower than the current points leader as he took second ahead of his Red Bull team-mate Mark Webber, who will drop five places due to a penalty for a gearbox change.
That will move Michael Schumacher into the top three on the grid on home ground. The German legend was on provisional pole for a while before ending up fourth quickest for Mercedes.
Three of the top four places on the grid will go to German drivers, as Force India's Nico Hulkenberg delivered a spectacular fifth-fastest time to give himself a season-best starting spot on row two. His team-mate Paul di Resta also reached Q3 and was ninth.
Pastor Maldonado completed the top six in his Williams, ahead of the two McLarens. Jenson Button was quicker than Lewis Hamilton, as the 2009 champion delivered his best qualifying performance since Bahrain in April.
Kimi Raikkonen was the final Q3 qualifier and rounds off the top 10 for Lotus.
The rain had arrived just before Q2 began, leading to a scramble to get a quick time in on the one or two laps that were always going to be the fastest of the segment. Among those who missed out were two of the men with five-place gearbox change penalties: Romain Grosjean (Lotus) and Nico Rosberg (Mercedes). They were 15th and 17th respectively.
Felipe Massa slithered off the road on his first Q2 lap and rejoined in Ferrari team-mate Fernando Alonso's path. Being blocked did not stop Alonso reaching Q3, but Massa's error consigned him to 14th.
Toro Rosso's Daniel Ricciardo almost made it into the top 10 as the rain he wanted arrived, missing the Q3 cut by just 0.06s. Also out in the middle segment were the two Saubers and Bruno Senna's Williams.
Q1 was fully dry and relatively predictable, although Schumacher, Button and Webber all cut it a little fine in either timing or pace terms. In the event, the eliminated midfielder was Toro Rosso's Jean-Eric Vergne, for the sixth time in his nine grands prix.
Heikki Kovalainen was nearly a second quicker than Caterham team-mate Vitaly Petrov, while Timo Glock found himself outqualified on home ground by Marussia stablemate Charles Pic, despite the rookie's lack of practice mileage.
Pos Driver Team Time Gap 1. Fernando Alonso Ferrari 1m40.621s
2. Sebastian Vettel Red Bull-Renault 1m41.026s + 0.405
3. Mark Webber Red Bull-Renault 1m41.496s + 1.838
4. Michael Schumacher Mercedes 1m42.459s + 2.880
5. Nico Hulkenberg Force India-Mercedes 1m43.501s + 3.329
6. Pastor Maldonado Williams-Renault 1m43.950s + 3.492
7. Jenson Button McLaren-Mercedes 1m44.113s + 3.565
8. Lewis Hamilton McLaren-Mercedes 1m44.186s + 0.875
9. Paul di Resta Force India-Mercedes 1m44.889s + 4.268
10. Kimi Raikkonen Lotus-Renault 1m45.811s + 5.190 Q2 cut-off time: 1m39.729s Gap ** 11. Daniel Ricciardo Toro Rosso-Ferrari 1m39.789s + 2.424 12. Sergio Perez Sauber-Ferrari 1m39.933s + 2.568 13. Kamui Kobayashi Sauber-Ferrari 1m39.985s + 2.620 14. Felipe Massa Ferrari 1m40.212s + 2.847 15. Romain Grosjean Lotus-Renault 1m40.574s + 3.209 16. Bruno Senna Williams-Renault 1m40.752s + 3.387 17. Nico Rosberg Mercedes 1m41.551s + 4.186 Q1 cut-off time: 1m16.686s Gap * 18. Jean-Eric Vergne Toro Rosso-Ferrari 1m16.741s + 1.048 19. Heikki Kovalainen Caterham-Renault 1m17.620s + 1.927 20. Vitaly Petrov Caterham-Renault 1m18.531s + 2.838 21. Charles Pic Marussia-Cosworth 1m19.220s + 3.527 22. Timo Glock Marussia-Cosworth 1m19.291s + 3.598 23. Pedro de la Rosa HRT-Cosworth 1m19.912s + 4.219 24. Narain Karthikeyan HRT-Cosworth 1m20.230s + 4.537 107% time: 1m20.991s
* Gap to quickest in Q1
** Gap to quickest in Q2