Mattias Ekstrom has taken pole position for the DTM season finale at Hockenheim, with title contenders Paul di Resta and Timo Scheider lining up second and third.
The reigning champion snatched pole from di Resta by four hundredths of a second, while Scheider finished the session two tenths adrift of the front row pair.
"It was very close between me and Mattias but he did a better lap," said di Resta. "I think we're in good shape for tomorrow, but Timo is only one place behind so anything can happen."
Ekstrom and di Resta did their best laps on their first set of tyres in Q3, but Scheider had to improve on his second run as he was briefly behind Jamie Green in the closing stages and did not want to start with a Mercedes between himself and di Resta.
Green took fourth in the end ahead of Bernd Schneider, while Bruno Spengler completed the top six, meaning that Scheider has di Resta's three HWA Mercedes teammates directly behind him on the grid, while di Resta himself has Ekstrom's Team Abt Audi ahead and Scheider's right behind.
Behind the top six, Martin Tomczyk and Tom Kristensen comple the top eigh and Mike Rockenfeller won the battle for top 2007 car to take ninth place in an extended second segment of qualifying.
All drivers were allowed through to Q2 after Q1 was red flagged when Markus Winkelhock crashed on the entry to the stadium section. The German was unable to get back out, so he will start last.
Pos Driver Car Time Gap 1. Mattias Ekstrom Audi 1:32.244 2. Paul di Resta Mercedes 1:32.284 +0.040 3. Timo Scheider Audi 1:32.492 +0.248 4. Jamie Green Mercedes 1:32.615 +0.371 5. Bernd Schneider Mercedes 1:32.680 +0.436 6. Bruno Spengler Mercedes 1:32.769 +0.525 7. Martin Tomczyk Audi 1:32.930 +0.686 8. Tom Kristensen Audi 1:33.005 +0.761 9. Mike Rockenfeller Audi 1:33.578 +1.334 10. Oliver Jarvis Audi 1:33.612 +1.368 11. Alexandre Premat Audi 1:33.737 +1.493 12. Gary Paffett Mercedes 1:33.742 +1.498 13. Christijan Albers Audi 1:33.770 +1.526 14. Maro Engel Mercedes 1:33.935 +1.691 15. Mathias Lauda Mercedes 1:34.459 +2.215 16. Ralf Schumacher Mercedes 1:34.499 +2.255 17. Susie Stoddart Mercedes 1:34.665 +2.421 18. Katherine Legge Audi 1:35.756 +3.512 19. Markus Winkelhock Audi no time