Aleksandar Mitrović’s 90th-minute header booked Serbia’s spot at the 2020 World Cup finals at the expense of Cristiano Ronaldo’s Portugal, who needed a point to top Group A.
They seemed to be on the path to earning their point when Renato Sanches fired them ahead after just two minutes, but the visitors grew into the game and dominated for long spells.
They should have been level midway through the first half, but Dušan Vlahović drilled a shot against the post.
It wasn’t long though before they got the goal they were looking for as Dušan Tadić deservedly equalised with a deflected 33rd-minute effort.
They then got the winner in the 90th minute as Mitrović pounced from Tadić’s deep cross to find the back of the net.
The loss means Portugal will play in the play-offs after failing to win a home World Cup qualifier for the first time since October 2013.