Graham Turner's men richly deserved their victory at the Greenhous Meadow, which looked unlikely when Shane Cansdell-Sherriff turned an early header into his own net.
However, Brendan Rodgers' difficult start to life as a top-flight boss continued as the visitors levelled through burly striker Marvin Morgan before Mark Wright put the hosts in front midway through the second half and Nicky Wroe finished Swansea off in the final minute.
After defeating Derby in the previous round, Shrewsbury approached the game full of confidence, knowing Swansea might be fragile as they adjust to life in the highest league.
Swans boss Rodgers made nine changes to the side that drew with Wigan at the weekend and it was a struggle to adjust at first as Morgan and Terry Gornell made life difficult.
Help was at hand for the visitors, courtesy of a needless own goal.
Although Danny Graham advanced beyond the defence when Andrea Orlandi pumped the ball forward, there appeared to be minimal danger until Cansdell-Sherriff stretched to reach it, succeeding only in knocking it past stranded goalkeeper Ben Smith.
Defiantly, Shrewsbury refused to let their heads drop and continued to take the fight to their supposedly superior opponents, who were already indebted to goalkeeper Jose Moreira for a string of eye-catching saves.
There was nothing Moreira could do to prevent Morgan's third goal in this competition though.
Lionel Ainsworth might have appeared to be going for goal from an acute angle but the effort fell perfectly for Morgan, who tapped home from close range.
It proved to be the prelude for an entertaining passage of play, during which time both teams had opportunities to score.
Leroy Lita started to make a nuisance of himself for Swansea, but not as much as Morgan, who guided a stoppage-time header against the bar, with Moreira totally stranded.
Although Shrewsbury found themselves on the back foot immediately after half-time, they were the ones who spurned the first clear opportunity.
Ainsworth was the guilty man, ignoring two team-mates clear to his left after he had streaked away, allowing himself to be robbed by Ashley Williams as he entered the area.
Swansea did enjoy a brief period of dominance but there was always a Shrewsbury body there to make a vital block or tackle.
Cansdell-Sherriff in particular made amends for his earlier mistake and by the time Wright put the hosts in front, Turner's men were well worth the lead.
Gornell deserved immense credit for the bulldozing run that pulled apart what should have been a neat Swansea back-line.
By the time Gornell rolled a pass to Wright, the midfielder was in acres of space and duly sent a low shot to the bottom corner.
Strangely, Wright had to be cajoled into celebrating by his delighted team-mates, although there was no shortage of jubilation from the stands.
Swansea tried to regroup but Shrewsbury had the last word as Wroe drove home.