Switzerland playmaker Xherdan Shaqiri proved Serbia's nemesis once more by helping knock Dragan Stojkovic's men out of the World Cup on a tumultuous night at Stadium 974.
Shaqiri netted a last-minute winner against Serbia at the 2018 tournament in Russia and celebrated by making an eagle shape with his hands to show his support for Kosovo, the country of his birth and a former Serbian province that declared independence in 2008. That independence is not recognised by Serbia.
The Chicago Fire man was booed and jeered throughout while at least one Serbia fan was thrown out for anti-Kosovo chanting.
Shaqiri had the last laugh with the opening goal as Switzerland, who came into the game knowing a draw would most likely be enough, advanced from Group G with a dramatic 3-2 win, alongside Brazil despite their surprise 1-0 defeat to Cameroon.
Switzerland nearly went ahead inside the first minute when Granit Xhaka's partially blocked shot fell beautifully for Breel Embolo but Serbia goalkeeper Vanja Milinkovic-Savic made a smart block before parrying Xhaka's follow up.
Andrija Zivkovic struck the post from 20 yards in response for Serbia but Murat Yakin's men deservedly led after 20 minutes.
Djibril Sow recovered Ricardo Rodriguez's left-wing cross and nudged it into the path of Shaqiri, who fired home via a deflection off Strahinja Pavlovic before running off to celebrate by putting a finger to his lips in front of the s
Serbia responded superbly six minutes later when Dusan Tadic's left-wing cross was guided brilliantly past Gregor Kobel by Aleksandar Mitrovic.
Shaqiri arrowed wide when clean through, before Tadic impressed again to find Vlahovic, who turned smartly to fire past Kobel despite Remo Freuler almost taking the ball away from the Juventus striker.
It was Switzerland’s turn to dig deep and they did so admirably, Embolo turning in Silvan Widmer’s cross at the far post to make it the first time since England v Argentina in 1998 that both teams had scored at least twice in a World Cup game before half-time.
Switzerland completed the turnaround three minutes into the second half. Shaqiri chipped the ball in for Ruben Vargas, who flicked the ball beautifully on for Freuler to finish expertly.
Tempers frayed as Serbia sensed their time in Qatar was coming to an end - substitute goalkeeper Predrag Rajkovic was booked for encroaching on to the pitch to confront the referee while a public address announcement asked for Serbian fans to stop making discriminatory chants and gestures.
There was one final flashpoint deep into stoppage time when Nikola Milenkovic and Xhaka clashed with several players looking to get involved. Both Milenkovic and Xhaka - another man with ethnic Albanian heritage linked to Kosovo - were booked.
What does it mean? Ronaldo and Portugal await
While Switzerland go on to a meeting with Portugal and Cristiano Ronaldo on Tuesday, Serbia will head home.
On the balance of play it was the right outcome. Switzerland wobbled towards the end of the first half but, for the most part, played with a composure that Serbia lacked.
Shaqiri joins illustrious duo
Shaqiri may be the man the Serbian fans love to hate but he showed his endearing quality once more with Switzerland's opening goal.
It meant he became just one of three players to score at each of the last three World Cup tournaments. The other two? Cristiano Ronaldo and Lionel Messi.
Evergreen Tadic shows his class
Tadic may be 34 but he remains Serbia's creative hub. He supplied the opener with a delicious cross from the left and was also instrumental in the second, although Freuler should have done better with his attempted clearance.
Whether he continues to play international football remains to be seen but he will leave a sizeable hole should he opt to stand down.
Switzerland finish as runners-up to Brazil in Group G, and go on to face Portugal in four days' time.
Serbia go home having taken just one point from their three games, against Cameroon.