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
-
Government working hard to complete Tema General Hospital project – Dr Okoe Boye
9 mins -
Ipswich Town seal Premier League promotion after 22 years absence
13 mins -
Accord journalists the respect due them – Opare Gyan
13 mins -
EPL: Arsenal beat Bournemouth to go four points clear of Man City
23 mins -
Cecilia Dapaah’s case: What’s happening now is a clear indication of cover-up – Amaliba
24 mins -
I felt rejected by Ghanaians – AY Poyoo
39 mins -
Terrorist cell of five Daesh supporters dismantled in Essaouira
1 hour -
My former manager deleted my songs from streaming platforms – AY Poyoo
1 hour -
Afronita and Abigail get standing ovation at Britain’s Got Talent
2 hours -
Accused in murder of a military officer in Kasoa remanded
2 hours -
OSP cleared Cecilia Dapaah of corruption after investigations, not AG’s office – Godfred Dame
2 hours -
OSP only gave EOCO a narrow remit to investigate money laundering – A-G
2 hours -
Ghana’s Osman Bukari wins second successive Serbian Super League title with Red Star
2 hours -
GES bemoans growing tattooing, multiple-piercing, and bleaching among pupils
3 hours -
GRA-SML deal: Majority kicks against publication of KPMG audit report
3 hours