Richie Barker struck a glorious 20-yard winner, his second vital goal in four days, to boost Mansfield Town's play-off hopes and deny City top spot in the table.
Barker's unstoppable drive into the roof of the net deep into first-half injury time also ended the visitors' five-match unbeaten run.
The Swans had edged the first half, but Mansfield took control in a controversial second half when full-back Gary Monk was red-carded for the third time this season and home winger Simon Brown was sent off for a headbut on Andy Robinson.
Shrewsbury moved seven points clear of the final relegation spot with a goalless draw at Bury.
The Shakers had veteran goalkeeper Andy Marriott to thank after a string of saves.
He pulled off great stops from Darren Moss, Sam Aiston and Duane Darby.