Mattias Ekstrom took pole position for Sunday's DTM race at Lausitz in dramatic fashion after nearly being eliminated in the first segment of a rain-affected qualifying session.
The Swedish driver only just scraped through the first part of qualifying, as several Audis opted not to do a lap immediately, despite the threat of rain in the air.
That shower came after most of the cars had completed a lap, but crucially three of the 2009 Audis, and free practice pace setters Oliver Jarvis and Alexandre Premat, had not set a time.
Those yet to do a lap had to switch to wet tyres and scrap for the final places in Q2. Reigning champion Timo Scheider was the only Abt Audi driver who had already got in, while the rest had to battle for the final Q2 spot.
Ekstrom eventually took the position, but he came under threat right at the end from Premat, who missed out by just 0.013 seconds.
Premat, Jarvis, Martin Tomczyk and championship leader Tom Kristensen all missed out, along with Johannes Seidlitz (who has withdrawn from the meeting after damage sustained in practice), and Ralf Schumacher (who did not complete a lap due to engine problems).
Qualifying calmed down after that, although there were more incidents as light rain continued to fall. Mike Rockenfeller, who pipped Scheider to the final place in the pole shootout, was then unable to do another lap as he spun into the gravel at the end of Q3.
That left Ekstrom battling with Mercedes drivers Gary Paffett and Paul di Resta. While Paffett was second fastest behind the Swede, he drops to seventh on the grid due to his five-place grid penalty from Hockenheim, leaving di Resta on the front row.
"It's seldom that a session goes like this," said Ekstrom. "At the start, I did what I was told, we scrubbed some wet tyres, then when we put slicks on it was raining.
"So then we put wets on, and I did the maximum, and it was enough by two hundredths of a second. That was my best lap of the session. Now I can laugh, but it would not have been funny if I had not got through, like some of my team-mates."
Behind Rockenfeller, Scheider and Spengler were able to edge the 2008 Mercedes of Jamie Green and Maro Engel in Q2, while Katherine Legge narrowly missed out on the top eight and will start from an impressive ninth place.
Pos Driver Car Time
1. Mattias Ekstrom Audi 1m33.205s
2. Paul di Resta Mercedes 1m33.534s
3. Mike Rockenfeller Audi
4. Timo Scheider Audi 1m33.983s
5. Bruno Spengler Mercedes 1m34.188s
6. Jamie Green Mercedes 1m34.758s
7. Gary Paffett Mercedes 1m33.435s
8. Maro Engel Mercedes 1m35.683s
9. Katherine Legge Audi 1m35.526s
10. Markus Winkelhock Audi 1m35.854s
11. Tomas Kostka Audi 1m36.424s
12. Mathias Lauda Mercedes 1m36.553s
13. Christian Bakkerud Audi 1m37.522s
14. Susie Stoddart Mercedes 1m38.581s
15. Alexandre Premat Audi 1m33.578s
16. Martin Tomczyk Audi 1m33.957s
17. Tom Kristensen Audi 1m34.571s
18. Oliver Jarvis Audi 1m34.648s
19. Ralf Schumacher Mercedes