The match had appeared to be heading towards a goalless draw before the visitors’ midfielder unleashed a powerful 25-yard drive to earn his side just their third away win of the season.
And to compound matters for Southampton, left-back Ryan Bertrand was then shown a straight red card by referee Michael Oliver in the final minute after a reckless late tackle on Swansea substitute Modou Barrow.
Southampton manager Ronald Koeman will be bemoaning his side’s inability to turn their dominance into points but they remain in the fourth and final Champions League berth, albeit on goal difference following Arsenal’s victory in the lunchtime kick-off.
In the first half, though, there appeared only one winner as Swansea barely made it beyond the halfway line, with wave after wave of Southampton attacks on Lukasz Fabianski’s goal.
However, despite their total dominance of possession in the first 45 minutes, Saints’ best chance came early on after fine approach play down their right flank from the ever-willing Nathaniel Clyne.
But when the right back’s pull-back fell at the feet of the on-rushing James Ward-Prowse six yards out, Swansea keeper Fabianski was in the right place at the right time to repel the midfielder’s effort.
Swansea, meanwhile, had to cope with the early loss of Dutch forward Marvin Emnes through injury, while lone striker Bafetimbi Gomis struggled throughout to hold the ball up and bring his team-mates into play.
After the half-time interval, though, there was a slight change of momentum as the visitors slowly began to get a foothold in the contest and Shelvey came desperately close to making the breakthrough just before the hour-mark.
Picking up possession midway in the Southampton half, the playmaker embarked on a mazy dribble that took him past a throng of opposition players only to see a low 20-yard drive beat Fraser Forster and rebound off the base of the post.
However, the Saints failed to heed that warning and with just three minutes remaining Shelvey once again tried his luck from distance, although on this occasion with a different outcome as Forster failed to divert his long-range effort past the upright.
Southampton did respond to that setback in the dying stages but second-half substitute Saido Mane was twice denied by Swansea captain Ashley Williams with desperate goal-line clearances.
And the skipper’s last-gasp interventions ensured Garry Monk’s men became just the third visiting side this season to leave St Mary’s with all three points.
Southampton: Forster (6), Clyne (7), Fonte (7), Yoshida (6), Bertrand (6), Davis (7), Reed (6), Tadic (6), Ward-Prowse (7), Elia (7), Pelle (6)
Subs: Mane (8), Seager (6)
Swansea City: Fabianski (8), Naughton (6), Fernandez (6), Williams (9), Taylor (6), Fulton (6), Carroll (6), Dyer (5), Shelvey (7), Emnes (6), Gomis (6)
Subs: Amat (6), Rangel (6), Barrow (6)
Man of the match: Ashley Williams