Swindon ended Shrewsbury's 14-game unbeaten run with goals by Christian Roberts and Barry Corr.
Shrewsbury, who had not lost since Boxing Day, took the lead in the 40th minute through veteran striker Leo Fortune-West.
Fortune-West, on loan from Rushden and Diamonds, blasted home from 12 yards after strike partner Derek Asamoah's clever back heel put him through.
Swindon equalised on 67 minutes when Sofiane Zaaboub's corner fell to Corr who smashed the ball home from six yards.
Welshman Roberts hit the winning goal six minutes later after Zaaboub's cross was flicked on by Corr, and Roberts headed home his 13th goal of the season from close range.
Swindon midfielder Michael Pook had the first shot of the game on 32 minutes when he tried his luck from 25 yards, but his effort was straight at keeper Chris MacKenzie.
After Fortune-West had opened the scoring Shrewsbury should have doubled their lead before the break.
Centre-half Kelvin Langmead hit a long clearance that Asamoah latched on to, but his lob from 30 yards landed on top of the net.
Swindon left-back Andy Nicholas was the first into the book on 46 minutes for a foul on Shrewsbury midfielder Dave Edwards.
Swindon centre-half Jerel Ifil almost snatched an equaliser but he could not keep his shot down from 15 yards following Andy Nicholas' long throw.
Langmead almost put a Roberts cross into his own net on 56 minutes, when he tried to clear but only succeeded in putting the ball just wide of the right-hand post.
Shrewsbury boss Gary Peters made a double change on 63 minutes when he took off front pairing Fortune-West and Asamoah and replaced them with Andy Cooke and Michael Symes.
This was quickly proven to be a big mistake as Swindon hit two goals in six minutes.
Swindon boss Paul Sturrock brought on Aaron Brown and Michael Timlin to replace Roberts and Zaaboub in the 82nd minute to shore up his team as they hung on to grab all three points and lift themselves back into the automatic promotion places.