Austria needed two goals in stoppage time to spare their blushes as they scraped past Kazakhstan in their Euro 2010 Group A qualifier in Salzburg.
Kazakhstan had appeared set to earn a shock point until Roland Linz and Erwin Hoffer struck at the death.
There had been few indications of the drama to come when Austria, playing their opening game of the campaign, made a positive start with Martin Harnik just missing the target from the centre of the penalty area in just the third minute, and he then saw Andrey Sidelnikov produce a fine save to keep another of his efforts out.
Marc Janko also wasted a fine chance for Dietmar Constantini's side and Sidelnikov was once again called into action as he kept out Franz Schiemer's angled drive.
The game was somehow goalless at the break and Kazakhstan gradually became more ambitious as the match went on. Nurbol Zhumaskaliyev even had a good chance to give them the lead but Austria keeper Jurgen Macho was alert to the danger.
Sidelnikov continued to frustrate the hosts, making a string of fine saves including one from Christian Fuchs' powerful shot.
But just when the match appeared set to finish without a goal, Linz collected Hoffer's pass and stroked the ball home with his left foot in the first minute of stoppage time.
Kazakhstan went in search of a leveller but Hoffer sealed the win on the counter-attack a minute later as he went around Sidelnikov from Linz's pass to slot home.