Rast had held the top spot after the first runs and improved his benchmark to a 1m20.033s in the final minute of the session.

But Green, who had been fourth in the first half of the session, swiftly deposed Rast from the top for his second pole of 2019 and his second in three races.

Green subsequently prevented championship leader Rast from taking the full three championship points for pole position.

Rast still scored two points and extended his championship lead to 49 points over Nico Muller, who followed a disastrous opening race with a disappointing qualifying position of 14th.

For Rast to seal the title one round early, he needs to outscore Muller by a further seven points this afternoon, as Muller can only score a maximum of 56 points at Hockenheim.

Mike Rockenfeller was another driver to improve his time late on and slotted into the middle of an all-Audi top six by placing third.

WRT Audi's Jonathan Aberdein continued his strongest DTM weekend yet by qualifying in fifth, behind Robin Frijns, after finishing Saturday's race fourth.

Loic Duval completed the Audi top six with Timo Glock placing as the best BMW driver in seventh.

The top 10 was rounded out by two-time DTM champion Marco Wittmann, Saturday podium finisher Bruno Spengler and Sheldon van der Linde.

Paul di Resta was the only R-Motorsport Aston Martin driver to fail to set a time after his crew spent the majority of the session working on his car due to an engine problem.

Ferdinand Habsburg was the highest-placed Aston Martin Vantage driver in 15th behind Muller.

UPDATE: R-Motorsport later tweeted that di Resta will not take part in the race following his Aston Martin's engine issues.

Session results: