Veteran forward Goran Pandev scored the decisive goal to send North Macedonia to Euro 2020 - the major tournament in their 27-year history.
The 37-year-old - North Macedonia's most capped player and all-time leading scorer - flicked the ball home in the 56th minute to see off Georgia in Thursday's play-off final.
The game was perhaps the biggest in the history of two young soccer nations, but no fans were allowed into the 54,000-seater national stadium in Tbilisi because of coronavirus restrictions in Georgia.
- Euro 2020: Hosts, dates, teams, fixtures
- Latest football results
- Scotland beat Serbia in shootout to reach Euros
- Agony for Northern Ireland vs Slovakia
With so much at stake, the match was predictably cagey and it took 28 minutes before either goalkeeper had to make a save when Georgian playmaker Tornike Okriashvili tested Stole Dimitrievski with a long-range shot.
There were 29 fouls in a stop-start match and only four shots on target but the neatly-worked winning goal was in contrast to the general scrappiness.
Eljif Elmas broke down the left and slipped the ball to Ilija Nestorovski inside the penalty area and he found Pandev, who beat Giorgi Loria for his 36th international goal.
The former Yugoslav republic will face Austria and Ukraine in Bucharest in Group C before taking on the top-seeded Netherlands in Amsterdam.
Currently No. 65 in FIFA's world rankings, North Macedonia will be the biggest outsider at Euro 2020 and the second newcomer, joining Finland.
Hungary qualify after late rally
Hungary qualified for the Euro 2020 finals with a thrilling 2-1 comeback win over Iceland thanks to a late equaliser from Loic Nego and a stoppage-time winner by Dominik Szoboszlai.
Hungary will join Portugal, France and Germany in Group F at next year's tournament, with the first and third of those games to be played at the Puskas Arena in Budapest.
Iceland had gone ahead when goalkeeper Peter Gulacsi fumbled a Gylfi Sigurdsson free-kick into his own net in the 11th minute, prompting a match-long onslaught form the home side.
Playmaker Szoboszlai was key to Hungary's effort, whipping crosses and set-pieces into the box, and he almost put his side level just before the break with a long-distance free-kick that required a full-stretch dive from Hannes Haldorsson to save.
The Hungarian siege on Iceland's goal continued in the second half, but they struggled to create many decent chances and looked vulnerable on the break as the visitors sought to exploit the space behind the home defence on the counter.
Iceland substitute Albert Gudmundsson almost killed the game off with a late sliding effort but just failed to connect with Jon Dadi Bodvarsson's cross and it was the costliest of misses.
French-born Hungary substitute Nego joined the fray in the 84th minute and he was quickest to a ball that pinged between defenders in the area, slotting home to equalise two minutes from the end of normal time.
Extra-time loomed but Szoboszlai had other ideas and capped a superb performance by firing home in the second minute of added time to seal a stunning win and send his side through to the finals, prompting wild celebrations by his team.
Scotland qualified for their first major tournament since 1998 after David Marshall saved Aleksandar Mitrovic's penalty in a shootout to send them to Euro 2020.
Scotland put their fans through the wringer as Steve Clarke's men were two minutes away from a 1-0 win in normal time in the winner-take-all clash after Ryan Christie's goal but a Luka Jovic injury-time equaliser forced extra-time.
Clarke had taken off his three most influential players - Lyndon Dykes, John McGinn and Christie - just before Serbia's dramatic equaliser and Scotland lost their spark in extra-time but they held on to take the game to penalties.
In the shootout, all five of Scotland's takers found the net before Mitrovic was denied by Marshall to send the Tartan Army through in dramatic fashion.
Scotland's reward for the win in Belgrade is a place in Group D alongside England, Croatia and Czech Republic, and a mouth-watering Euro 2020 schedule that will see two of their matches - against Croatia and Czech Republic - played in Glasgow.
But it was agony for Northern Ireland.
Their Euro 2020 dreams fell at the final hurdle as Michal Duris' extra-time winner sent Slovakia to next summer's finals with a 2-1 win at Windsor Park.
Slovakia had led for most of normal time with the opening goal handed to them by George Saville, whose poor backwards header was pounced upon by Juraj Kucka to fire home from the edge of the box (17).
A much-improved second-half performance from the hosts was finally rewarded three minutes from full-time when Paddy McNair's cross was bundled past his own goalkeeper by Inter Milan defender Milan Skriniar, which took the tie to extra-time.
But some more poor defending allowed a loose ball to find Duris with 10 minutes of the extra half-hour remaining, and after Bailey Peacock-Farrell allowed his shot to beat him at his near post, Northern Ireland could find no way back as their qualification hopes were extinguished in the play-off final.