Paul di Resta took advantage of an early stop strategy and a well-timed safety car period to win the Saturday DTM race at the Hungaroring from 13th on the grid.
Audi had looked set to continue its qualifying dominance early in the race, with pole-sitter Rene Rast leading Mattias Ekstrom and Jamie Green in the early stages.
But Audi's good start started to unravel when di Resta and BMW drivers Bruno Spengler and Timo Glock pitted under the first six laps.
Soon after they changed tyres Maxime Martin stopped on track with damage to the front of his car, meaning that the safety car's arrival closed the pitlane.
The safety car allowed di Resta, Spengler and Glock to make up the ground lost during their stops and as the rest of the field made their mandatory stops over the race, the trio eventually moved to the front of the field and never relented.
The leading three ran closely from then on, but di Resta held off Glock and Spengler for the win.
Mike Rockenfeller's race came to life late on in the race after becoming the first Audi driver to pit, and undercutting stablemates Rast and Green.
He ran side-by-side with Spengler on the main straight on the final lap but with the BMW driver having the inside line, but Rockenfeller was unable to dispose his rival for third.
Mattias Ekstrom had led the race at the safety car restart following Martin's damage but ended fifth, a further five seconds behind Spengler and Rockenfeller's battle.
Rast ended up sixth from pole ahead of Green.
The Briton had been running in eighth, and had to defend from Edoardo Mortara after his pitstop, the Italian trying to overtake at the Turn 6-7 chicane, forcing Green to cut the corner.
The aggressive move compromised Mortara's momentum, allowing his 2016 title rival Marco Wittmann to pass him.
Green then passed Gary Paffett for seventh, with Wittmann taking the final points position.
UPDATE: Green was excluded from the result after the race for a technical infringement relating to the front splitter, following a protest from Mercedes. Audi has announced its intention to appeal.
RESULTS - 34 LAPS
|1||Paul Di Resta||HWA||Mercedes||57m52.984s|