Fulham striker Aleksandar Mitrovic scored a dramatic late winner as Serbia booked their place at next year's World Cup and condemned Portugal to the play-offs.
Hosts Portugal only needed a draw to qualify and looked to have done enough, with Renato Sanches' opener cancelled out by Dusan Tadic's equaliser.
Mitrovic, who started the game on the bench, was sent on at half-time but Portugal were wise to his threat and kept him largely quiet.
However, the home side let their concentration slip in the final seconds and Mitrovic pulled away from his marker to meet Tadic's deep ball and send a downward header into the back of the net.
The goal prompted wild celebrations on the bench and on the pitch from the Serbia players and staff while the Portuguese team stood in disbelief with the home crowd silenced.
Serbia finish top of Group A with 20 points, three more than Portugal, whose hopes of playing in Qatar next year rest on two rounds of play-offs in March.
The defeat also ended Portugal's unbroken winning run in home World Cup qualifiers which had stretched back to October 2013.
It had looked like being a long night for the visitors after they fell behind inside just two minutes when Sanches finished confidently after Bernardo Silva had won possession.
But Serbia did not let their heads drop and deservedly equalised when Rui Patricio failed to keep out Tadic's shot, which crept over the line.
Cristiano Ronaldo, himself familiar with scoring late goals with Manchester United this season, was quiet and came closest with a free-kick in the first half.
Instead it was Mitrovic who provided the drama in the closing stages as his header secured a famous win for Serbia.
Latest Stories
-
Otumfuo Osei Tutu II celebrates 25 years of peaceful rule on golden stool
13 seconds -
We have enough funds to pay accruing benefits; we’ve never missed pension payment since 1991 – SSNIT
25 mins -
Let’s embrace shared vision and propel National Banking College – First Deputy Governor
1 hour -
Liverpool agree compensation deal with Feyenoord for Slot
1 hour -
Ejisu by-election: There’s no evidence of NPP engaging in vote-buying – Ahiagbah
1 hour -
Ejisu by-election: Independent ex-NPP MP’s campaign team warns party against dubious tactics
2 hours -
ZEN Petroleum supports Tse-Addo Future Leaders School
2 hours -
NPP must win back Adentan seat in 2024 polls – Obeng Fosu
3 hours -
PPA Clarification: The dark side of the World Bank’s ‘giveaways’ in Ghana by Bright Simons
4 hours -
Blinken says China helping fuel Russian threat to Ukraine
4 hours -
MHA declares May as Purple Month for Mental Health Awareness
5 hours -
WAEC arrests former headmaster over illegal students registration
5 hours -
MeToo founder Tarana Burke defiant after Harvey Weinstein ruling
5 hours -
Be alert, insist on decent messages – Dwumfour tells media
5 hours -
Father jailed 10 years for burning daughter’s genitals with hot cutlasses
6 hours