Luka Jovic's last-second header denied Slovenia a first-ever win at the Euros as Serbia snatched a 1-1 draw in Munich on Thursday.
It looked like the Dragons were going to hold out for a victory after Zan Karnicnik's strike, but Serbia's last push for an equaliser eventually proved fruitful.
After a bright start, Slovenia came closest to taking the lead when Timi Max Elsnik struck the post with a powerful shot before Benjamin Sesko lifted the rebound over the bar.
Aleksandar Mitrovic endured a frustrating game, being denied by two big saves from Jan Oblak either side of half-time after the goalkeeper had previously kept out Dusan Vlahovic's glancing header.
Karnicnik eventually took matters into his own hands, starting his run at right-back before switching it out to Elsnik, continuing his run to scuff a volley past Predrag Rajkovic from close range.
Mitrovic had the golden chance to equalise for Serbia just moments later, meeting a cross on the half-volley, but the slightest of touches from the Slovenia goalscorer sent his effort against the bar.
In the dying seconds of the game, Serbia won another corner, and this time, Jovic rose highest inside a crowded six-yard box to thump a header past Oblak for a valuable late equaliser in Group C.
Data Debrief: Impact sub Jovic to the rescue
Jovic came off the bench in the 64th minute and only managed seven touches in the game. He will not care though, as the one that counted got the winner.
His goal is the latest result-altering goal in a Euros match of all-time (exlcuding extra time), with his equaliser timed at exactly 95 minutes.
Slovenia have scored six goals at the European Championships, with Karnicnik's strike their fourth against Serbia/Yugoslavia in the competition. Indeed, the Dragons have only ever taken the lead twice in a Euros game, and both times it has been against Serbia/Yugoslavia (also in 2000 in a 3-3 draw).