German GP: Alonso zooms to second straight pole
The Ferrari driver pipped Mark Webber on his penultimate lap as the rain lashed down on the Hockenheimring circuit, topping the grid for the second-consecutive race.
Webber was then demoted to third by Red Bull teammate Sebastian Vettel, with Mercedes' Michael Schumacher settling for fourth place, which looked unlikely when the German barely scraped through the first session in 17th position.
Nico Hulkenberg was fifth for Force India while his teammate Paul Di Resta was ninth fastest.
Jenson Button and Lewis Hamilton were seventh and eighth. It was the first time Button had outqualified his McLaren teammate in the season.
An enthralling qualifying event saw three sessions with different weather conditions that played havoc with lap times.
The dry first spell saw Hamilton cruise to the top of the standings, while in the second session, which was affected by light rain that had most drivers switch to intermediate tires, Schumacher took the top spot, only to be overtaken by the Briton toward the end.
A dramatic last session began in the pouring rain.
Schumacher, the sport's top driver in the wet despite crashing into the barriers in practice Friday, posted the top time early on, but was then outdone by countryman Vettel.
The reigning champion appeared to be knocked off the front of the grid by Webber as the clock ticked to zero, but he had managed to start his final lap by then and regained P2 at the death.
Vitaly Petrov was outqualified by teammate Heikki Kovalainen for only the second time this season, the Caterham pair in 19th and 20th, respectively.
1. Fernando Alonso (Ferrari)
2. Sebastian Vettel (Red Bull)
3. Mark Webber (Red Bull)
4. Michael Schumacher (Mercedes)
5. Nick Hulkenberg (Force India)
6. Pastor Maldonado (Williams)
7. Jenson Button (McLaren)
8. Lewis Hamilton (McLaren)
9. Paul Di Resta (Force India)
10. Kimi Raikkonen (Lotus)
11. Daniel Ricciardo (Toro Rosso)
12. Sergio Perez (Sauber)
13. Kamui Kobayashi (Sauber)
14. Felipe Massa (Ferrari)
15. Romain Grosjean (Lotus)
16. Bruno Senna (Williams)
17. Nico Rosberg (Mercedes)
18. Jean-Eric Vergne (Torro Rosso)
19. Heikki Kovalainen (Caterham)
20. Vitaly Petrov (Caterham)
21. Charles Pic (Marussia)
22. Timo Glock (Marussia)
23. Pedro de la Rosa (HRT)
24. Narain Karthikeyan (HRT)