David Marshall was the hero as Scotland reached the Euro 2020 finals with a penalty shoot-out win over Serbia in Belgrade.
Scotland, of course, did it the hard way as they reached their first major tournament since 1998 after a 1-1 draw.
Ryan Christie's strike appeared to have sent Steve Clarke's dominant side into Euro 2020 but Serbia scored with their first effort on target in the 90th minute.
However, the blow proved to be fleeting as Marshall saved from Aleksandar Mitrovic in the 10th penalty of the shoot-out.
Christie gave Scotland a deserved 52nd-minute lead with an excellent strike from outside the box and Steve Clarke's side had chances to give themselves an extra cushion.
They would regret not getting a second goal, despite looking comfortable for the vast majority of normal time.
Marshall was rarely troubled, the Scotland defence were resolute when they needed to be, the midfield composed and confident and Christie, John McGinn and Lyndon Dykes gave the home defence serious problems.
But Serbia put Scotland under some late aerial pressure and Luka Jovic headed home unchallenged following a corner 20 seconds before the 90-minute mark.
However, Scotland secured a 5-4 penalties triumph to set themselves up for two Hampden encounters against Croatia and Czech Republic and a Wembley clash with England at next summer's delayed finals.
The signs were good coming into the clash in Red Star's Rajko Mitic Stadium.
Scotland were eight matches unbeaten and had recorded four wins and three clean sheets on the trot.
Clarke went with the bulk of the team that had won three matches in October but Kieran Tierney and Christie returned, the latter for the injured Ryan Fraser, after the pair were instructed to self-isolate last month.
There was more encouragement from the early stages as Scotland dominated possession and territory in the opening 10 minutes, getting several crosses into the box without finding a blue shirt, before Christie drew a save from an ambitious free-kick.
Serbia were barely seen as an attacking force until coming close midway through the half. Aleksandar Mitrovic laid the ball back for Sasa Lukic who steered the ball a yard wide from the edge of the box.
Scotland came closer when Christie fed McGinn after a long ball, the latter's shot gathered at the second attempt.
Scotland continued to threaten and skipper Andy Robertson spurned a glorious chance five minutes after the break after Lyndon Dykes had seen off three defenders to roll the ball into his path. The Liverpool player sliced his shot well over.
The Scots were ahead 90 seconds later. Callum McGregor intercepted and fed his Celtic team-mate, Christie, who swivelled and fired the ball in off the post from 22 yards.
Christie soon had a volley saved following a Dykes head-on and Scotland remained in control.
Serbia had to step up a gear and did so in the final 20 minutes. Headers from Sergej Milinkovic-Savic and Mitrovic were not far wide but Scotland were still creating chances.
McGregor saw a long-range effort swerve just wide and Christie came close after running on to a long ball.
The home pressure increased and Jovic headed wide from a good chance but Scotland looked to be riding it out until the substitute evaded marker Scott McTominay amid a crowd of bodies to head home unchallenged from Filip Mladenovic's corner.
Clarke had taken off his most advanced three players in the final seven minutes of normal time with Oli McBurnie, Callum Paterson and Kenny McLean now finding themselves leading the charge after being brought on to help shore up a lead.
Stephen O'Donnell and Ryan Jack came close from long range in the opening moments but Scotland were soon under pressure again and Marshall produced a brilliant fingertips save to divert Nemanja Gudelj's long-range effort away from the top corner.
Scotland had lost their attacking rhythm and Clarke threw on Leigh Griffiths in the 117th minute for his first cap in more than two years.
Griffiths' first involvement was to fire home the opening penalty of the shoot-out. McGregor, McTominay, McBurnie and McLean also netted before Marshall denied Mitrovic.