It was the Eagles who were quicker out of the blocks, with Aleksandar Mitrovic forcing an early save from Yann Sommer with a solid header.
Within 60 seconds the striker broke the deadlock with another header, flicking his effort home superbly as he rose to meet a Dusan Tadic ball in from the right flank.
Five minutes later Blerim Dzemaili scuffed a shot well wide as the Swiss sought to respond and a further five minutes on Sergej Milinkovic-Savic belted a 25-yarder just wide at the other end.
On the half-hour Serbia goalkeeper Vladimir Stojkovic kept his side ahead as he kept out a close-range Haris Seferovic, with Shaqiri having carved out the chance with an astute pass.
Shortly before half-time Sommer tipped away a cross-shot by Nemanja Matic, before Dusko Tosic failed to make contact with an attempted header from a corner.
Tadic was the last player to threaten in the first half, flashing a left-foot drive a foot too high after he collected a knock-down from Mitrovic.
Early in the second half Mitrovic headed over from a corner, before Switzerland went straight down the other end of the pitch and equalised in stunning fashion.
Shaqiri had an effort blocked and the ball fell across the face of the area for Granit Xhaka to smash home a superb left-foot shot which left Stojkovic helpless.
Shaqiri then hit the outside of a post with a first-time curler from the eight side of the area, with Serbia still trying to get a foothold back in the game.
The Eagles did eventually start to get hold of the ball, with Mitrovic seeing claims for a penalty waived away despite him being manhandles by two defenders.
Stojkovic denied substitute Mario Gavranovic as time ticked away, but Switzerland had the final say in the final minute of normal time as Shaqiri raced away from the halfway line and calmly rolled a low finish under the advancing Stojkovic to win the game.
Download our app and read this and other great stories on the move. Available for Android and iOS.