Scotland qualified for a first major international tournament since 1998 by reaching Euro 2020 thanks to a 5-4 win on penalties over Serbia after a 1-1 draw in Belgrade.
The Scots' demons of two decades without qualifying seemed set to reappear when Luka Jovic's 90th-minute header sent the game into extra time.
Ryan Christie's opener had deservedly put the visitors in front during what had been a fine performance from Steve Clarke's men.
But just like in a semi-final shootout win over Israel, Scotland kept their cool with five perfect penalties and finally got over the line when David Marshall saved from Aleksandar Mitrovic.
"This time we didn't let them down. The whole nation can be proud but nobody more so than the players on the pitch," said Clarke.
Goalscorer Christie and captain Andy Robertson welled up with emotion as a generation of Scots can look forward to a major tournament for the first time.
There is an extra reward of two matches at Hampden against the Czech Republic and Croatia and a clash with old rivals England come June.
"I'll say every sort of prayer I have to have a full Hampden because my God we'll feel it," Robertson told Sky Sports.
"I hope everyone has a party tonight because we have been through tough times as footballers and football fans. 23 years and we've done it. I don't want to think about it because I'll probably cry."
Christie missed the play-off semi-final win over Israel last month after he was categorised as a close contact of Stuart Armstrong, who tested positive for coronavirus after joining up with the Scotland squad.
The Celtic midfielder spoke openly about the mental challenge of having to self-isolate indoors for 14 days on his return to playing and hoped qualification can offer some relief to those struggling with lockdown restrictions in Scotland.
"I'm gone," said a tearful Christie. "It's for the whole nation, it's been a horrible year for everyone.
"We knew coming into the game we could give a little something to the country and I hope everyone back home is having a party tonight because we deserve it. We've been through so many years and it's the monkey off the back now."
Scotland are now unbeaten in nine games stretching back 13 months and the confidence Clarke has instilled in his side showed as the visitors controlled the first 90 minutes.
- Christie's moment of quality -
Had it not been for an injury to Ryan Fraser, it is unlikely Christie would have started, but he produced the moment of quality his nation was crying out for on 52 minutes.
Christie collected Callum McGregor's pass on the edge of the box then fired low, in off the post, on his favoured left foot.
Scotland continued to have the upper hand but couldn't score the killer second goal as McGregor and then Christie fired powerful shots inches wide.
Jovic has struggled to make an impact since a 60 million euro ($71 million) move to Real Madrid last year, but broke Tartan Army hearts as the game entered stoppage time.
Scotland had not conceded a goal in over 470 minutes but incredibly left Jovic all alone in the heart of the area to head home a corner.
Serbia had all the momentum going into extra time with Clarke having withdrawn the dangerous Lyndon Dykes, Christie and McGinn towards the closing stages of normal time.
Marshall had to produce a brilliant save from Nemanja Gudelj a winner.
And the Derby goalkeeper was the hero in the shootout after Leigh Griffiths, McGregor, Scott McTominay, Oli McBurnie and Kenny McLean had found the net.