Keith Millen's side started the day in 22nd place in the league table but moved out of the relegation zone as they got back to winning ways thanks to Brett Pittman's first goal for the club and a stunning long-range effort from David Clarkson at Ashton Gate.
After Steve Howard had missed a penalty for Leicester, substitute Pittman swept the ball just over the goal-line for the opener in the 57th minute following a well worked free-kick.
Christian Ribeiro was fouled by Greg Cunningham on the right wing and Jamie McAllister took the free-kick short, had it back and whipped a cross into the box which Pittman stabbed goalwards from 12 yards, and despite the best effort of Foxes defender Ritchie Wellens, the ball crept in for 1-0.
David Clarkson made the game safe in the 90th minute when he fired the ball into the top left-hand corner from 30 yards to secure all three points.
It could have been a different story had Sven-Goran Eriksson's side taken advantage of their early pressure.
It was the team from East Midlands who started the better of the two sides and had the first real chance of the game when David James hauled down Andy King inside the penalty area on 21 minutes as the seven-goal hitman attempted to go round him after racing clear of the Bristol defence.
However, the 53-cap England goalkeeper immediately redeemed himself by blocking Howard's low penalty with his legs to keep the score at 0-0.
Leicester had other chances during the first half to grab the opener, the best of which came just five minutes after Howard's missed penalty when Paul Gallagher rose highest inside the box but his header crept just inches wide of the far post with James well beaten.
Bristol City were a different side after the break after swapping Lee Johnson for Pittman in what turned out to be an inspired move, although it was the away side who had the first chance of the half.
Paul Gallagher's corner was swung into the far post where a host of Foxes players were waiting but Jon Stead managed to hook the ball clear.
Strikers Darius Vassell and Martyn Waghorn were thrown into the action on by Eriksson as he attempted to get his side back into the game following Pittman's goal.
Despite a few nervy moments late on, The Robins never really looked like conceding and even managed to snatch a late second through another substitute, Clarkson, as Leicester surged forward in search of a leveller.