Match ends, Wales 1, Austria 0.
Teenager Ben Woodburn scored with a brilliant long-range strike four minutes after coming on for his international debut to breathe new life into Wales' bid to qualify for the 2018 World Cup.
Needing victory to maintain a realistic prospect of qualifying automatically, Wales were overrun by Austria in a goalless first half in which Marko Arnautovic and Marcel Sabitzer wasted good opportunities for the visitors.
The hosts continued to toil - seemingly to no avail - after the break until the 74th minute, when 17-year-old Woodburn unleashed a fierce 20-yard shot to send a packed Cardiff City Stadium wild.
With Serbia's victory over Moldova strengthening their position at the top of Group D, Wales remain four points behind the leaders with three games left.
However, Chris Coleman's side have narrowed the gap on the second-placed Republic of Ireland to two points following a draw for Martin O'Neill's men in Georgia.
They travel to face the Moldovans on Tuesday - while Ireland host the Serbs - before a trip to Georgia and a potential decider with the Irish in Cardiff next month.
Only the nine group winners in Europe's qualifying procedure automatically earn a place in next year's tournament in Russia, while the eight best runners-up enter the play-offs.
And although Wales' hopes of qualifying automatically remain out of their hands, the fact they still have any chance at all - and the manner in which Woodburn ensured that was the case - made for a delirious atmosphere in Cardiff.
Woodburn to the rescue
Even before they appeared to be heading for a stalemate against Austria, Wales' chances of qualifying were already hanging by a thread having drawn their five previous games.
Coleman had said they needed to win their remaining four fixtures to be in contention for automatic qualification and, knowing even a draw could be terminal, he boldly handed Derby forward Tom Lawrence a first competitive start for Wales, in an advanced midfield role alongside the returning Gareth Bale.
The Real Madrid forward was suspended for June's draw in Serbia, though he was less influential than usual as Austria dominated the early exchanges in Cardiff.
The visitors monopolised possession for long periods, searching patiently for opportunities to unlock the home defence but struggling to make their pressure count as Arnautovic blazed over from a promising position in the Welsh penalty area.
The hosts improved in the second half, benefitting from Coleman's decision to switch from his favoured 5-4-1 formation to a 4-2-3-1 system designed to mirror and negate Austria's.
His moment of inspiration, however, was to bring on Woodburn.
Still just 17, the Liverpool player had been in senior Wales squads before without making it on to the pitch, and it seemed a brave move from Coleman to turn to the youngster in this moment of need.
Woodburn wasted little time in making his mark, controlling a loose ball five yards outside the Austrian penalty area, taking another touch to get it out of his feet and then driving a fabulous shot past a stretching Heinz Lindner at his near post.
Coleman's changes bear fruit
Whether Wales reach the finals in Russia or not, Coleman has said this World Cup campaign will be his last in charge of his country, though he claimed thoughts of his future had not entered his mind in the build-up to this vital fixture.
He cut a frustrated figure on the touchline in the first half, gesturing angrily as he watched his side outplayed by their opponents.
Sensing the game - and Wales' World Cup hopes - were slipping away, Coleman took the initiative during the interval by replacing defender Jazz Richards with midfielder Andy King and making the pivotal formational switch.
The decision paid dividends, stemming the flow of Austrian pressure and allowing the likes of Bale to grow into the game.
Even after Woodburn's sensational introduction, Wales could have added to their lead in a frantic finale.
Another substitute, Hal Robson-Kanu, cleared the crossbar with one wild effort and struck the bottom of the post with another, while Bale forced Lindner into a decent save with a spectacular overhead kick.
Despite the flurry of late chances, however, the overriding emotion for Wales' exhausted players and fans at the final whistle was one of relief.
Man of the match - Ben Woodburn (Wales)
What they said
Wales manager Chris Coleman: "It is one of those nights to remember. It was a great way to win the game. Ben is young but we have seen enough. This is not a player we have just discovered, we have had him for some years.
"I had no worries about him at all. It wasn't just his goal, it was his all-round play, his intelligence. I am delighted for him.
"We are a couple of points back on the Republic and they have got to come to us. That is the last fixture here. But the biggest we've had in a long time is away to Moldova. We have to take care of our own business. Three games to go, anything can happen."
Wales goalscorer Ben Woodburn: "The ball just came out of the air and I just tried to shoot it as quickly as I could.
"It's a great feeling, I couldn't ask for much more from the fans. I won't sleep tonight."
- 5ChesterBooked at 25mins
- 3RichardsSubstituted forKingat 45'minutes
- 7LawrenceSubstituted forWoodburnat 69'minutes
- 18VokesSubstituted forRobson-Kanuat 69'minutes
- 15PrödlBooked at 25minsSubstituted forDansoat 27'minutes
- 14BaumgartlingerBooked at 83mins
- 9SabitzerSubstituted forGregoritschat 79'minutes
- 11HarnikSubstituted forJankoat 81'minutes
- Ovidiu Hategan
- Shots on Target
Second Half ends, Wales 1, Austria 0.
Hal Robson-Kanu (Wales) hits the right post with a left footed shot from outside the box. Assisted by Ben Woodburn.
Corner, Wales. Conceded by Heinz Lindner.
Attempt saved. Gareth Bale (Wales) left footed shot from the centre of the box is saved in the top right corner.
Attempt missed. Hal Robson-Kanu (Wales) left footed shot from outside the box is too high. Assisted by Ben Woodburn.
Offside, Austria. Kevin Danso tries a through ball, but Marc Janko is caught offside.
Foul by Marc Janko (Austria).
Wayne Hennessey (Wales) wins a free kick in the defensive half.
Attempt blocked. David Alaba (Austria) left footed shot from outside the box is blocked. Assisted by Aleksandar Dragovic.
Marc Janko (Austria) wins a free kick in the defensive half.
Foul by Ashley Williams (Wales).
Foul by Michael Gregoritsch (Austria).
David Edwards (Wales) wins a free kick in the defensive half.
Foul by Michael Gregoritsch (Austria).
Chris Gunter (Wales) wins a free kick in the defensive half.
Julian Baumgartlinger (Austria) is shown the yellow card.
Foul by Aleksandar Dragovic (Austria).
Hal Robson-Kanu (Wales) wins a free kick on the right wing.
Stefan Ilsanker (Austria) wins a free kick in the defensive half.