Gareth Bale completed a match-winning hat-trick deep in injury time to spare Wales from embarrassment against Belarus in Russia and keep alive their hopes of qualifying for the 2022 World Cup.
Wales made the ideal start as the first of two Bale penalties gave them an early lead, but they unravelled in two calamitous first-half minutes as goals from Vitali Lisakovich and Pavel Sedko put Belarus in front.
Lisakovich scored from the spot after Chris Gunter was penalised for a raised foot, before an unmarked Sedko punished shambolic defending from Wales, who were fortunate not to be further behind at half-time.
Bale scored his second penalty to bring Wales level midway through the second half and, in the third of four minutes of injury time, the captain came to his country's rescue with a low shot that squirmed under Belarus goalkeeper Sergei Chernik and into the net.
After losing their opening match of the campaign to group leaders Belgium, Wales could ill afford to draw this game, never mind lose it.
And having stared at an ignominious defeat in Kazan which would have effectively ended their aspirations of qualifying automatically for the 2022 World Cup in Qatar, this fortuitous victory keeps the dream intact, no matter how improbable it may be.
Only the group winners qualify automatically and Group E leaders Belgium, ranked number one in the world and unbeaten in their four matches to date, remain overwhelming favourites ahead of the second-placed Czech Republic and Wales, who are third with a game in hand.
Robert Page's side have another five games to catch their rivals - starting against Estonia in Cardiff on Wednesday - but, even at this early stage, the play-offs look like their likeliest route to a first World Cup appearance since 1958.
Finishing second in their group would secure a play-off spot, but Wales at least have the peace of mind that winning their most recent Nations League group has all but ensured their passage to the play-offs.
That might have been what most would have expected of Wales when they were drawn in such a challenging group but, after this escape act against a Belarusian side 89th in the world rankings, they still have an outside chance of overhauling Belgium.