Rory Fallon scored his eighth of the season to give Swindon boss Iffy Onuora his first win since taking charge in September.
The New Zealand striker pounced on 31 minutes to lift the Robins closer to the teams above them at the foot of League One.
It was Bristol City boss Gary Johnson's sixth straight defeat.
City had started the brighter of the two sides in a hotly contested opening.
Swindon defender Sean O'Hanlon was ruled to have handled inside the area and consequently a penalty was awarded in front of the ecstatic away support.
Scott Murray stepped up only to see his spot-kick saved by Tom Heaton but the referee ruled that the keeper had moved off his line too quickly.
Murray then dispatched with aplomb at the second time of asking.
Swindon soon levelled when Michael Pook was fouled on the edge of the area.
Andy Gurney stepped up to shoot but then slid a clever ball inside to Neale McDermott and the on-loan Fulham midfielder wasted no time in scoring his first goal for Swindon with a sweet right-foot shot.
Gurney then almost increased the lead when another free-kick curled narrowly over.
It was soon to get worse for City as Stefani Miglioranzi fed Hameur Bouazza and his pace was too much for Osei Sankofa who pulled him back with a professional foul.
The ensuing free-kick though was fired straight at Adriano Basso.
City then were pushed further into the mire with Fallon's decisive winner.
Miglioranzi played a delightful one-two with McDermott and continued his run deep into the City penalty area.
His pass fell at the feet of Fallon and he turned sharply past former Swindon defender Matt Heywood and smashed a great finish past Basso.
The second half petered out as Swindon seemed content to hold on to the two goals.
Heaton though produced a fantastic save with nine minutes to go to tip over a Steve Brooker header.