Carlisle United came away from Ashton Gate with nothing to show from a game in which they held the upper hand for long periods.
Two second half set pieces in the space of two minutes for the Robins proved to be the tipping point as substitute Marvin Elliott struck twice to help his side claim the points which lifted them out of the bottom four.
Young loanees Charni Ekangamene and Mike Drennan made their full debuts in a game both sides had targeted in their pre-match build up and an early United corner brought away shirts into the box. Berrett was there but he pulled his delivery and it was easily cleared at the near post.
The Cumbrians had another set piece opportunity as they controlled the play in midfield and Berrett was once more the provider as he swung the ball into the box. A half clearance fell nicely for Noble but his clipped effort back into the mix was easy for the keeper to claim.
United were almost gifted a goal on 12 minutes when the Robins messed around with the ball deep inside their own half. Drennan stepped in to intercept and his 25-yard thunderbolt rattled frustratingly back off the angle of post and bar with Moore well beaten.
The Robins responded with a good period of play and they doubled up down the right flank to whisk a dangerous cross into the box. O'Hanlon did well to flick it away as it deflected off Robson and arrowed towards the target.
Another good chance followed when Baldock tussled with O'Hanlon for a ball over the top. The nippy striker held it up well and fed it for Cunningham to cross. Reid arrived late in the box and he was an inch away from finishing it off.
Both sides battled hard in midfield and it needed a moment of skill from Jay Emmanuel-Thomas to fashion another chance when he took a high dropping ball on his toe inside the area. A turn took him past his Fleming and had to dive low to save as a wicked shot came in.
The Blues grabbed the lead in spectacular style 10 minutes before half time when Ekangamene was cynically scythed down by Aden Flint. Brad Potts placed the ball and drilled it under the wall and into the bottom corner much to the annoyance of the unsighted keeper.
Carlisle tails were up and Amoo streaked past two to make it the byline with Potts up in support. Everything was right until the cut back spun harmlessly away to safety.
A Reid free kick from deep caused problems for the visiting defence as a flick from Pack allowed El-Abd to ghost in. Fleming was brave as he scampered off his line to grasp it.
Liam Noble kept up the forward momentum from the restart when he overlapped to take a pass from Potts into the area. Hus cut back on the run brought a corner and Flint had to clear it as O'Hanlon jumped for the header.
A drop of the shoulder from David Amoo left him with clear space to run at and his cross shot was perfect for Drennan until the offside flag went up.
The Robins finally brought some appreciative applause from their sizeable home support when Pack, Baldock, Wagstaff and Emmanuel-Thomas combined to carve their way through the heart of the back line. Substitute Marvin Elliott stepped in to take over and his shot ricocheted just past the post.
The corner brought a flick from Elliott at the near post and O’Hanlon had a moment of worry as his clattered clearance smashed into Emmanuel-Thomas and bounced away at pace. Fleming had it covered as it whistled past his upright.
City were in determined mood and Wes Burns did well to cross from a tight angle as he came under pressure from Ekangamene. Baldock tried to get a touch but United were back in numbers and the chance was smothered.
Potts had a shot from distance blocked as he tried to relieve the pressure by taking the game to the hosts but intensity levels increased again as City threw extra men forward. A perfect tackle from Chimbonda on the well placed Tyrone Barnett sparked a period of play which completely turned the game on its head. United couldn’t deal with a string of Baldock crosses and Marvin Elliott didn’t need to be asked twice when he was left unmarked and with the simple task of nodding the ball into an empty net.
The Robins pressed on from the restart and another dipping and swirling set piece bounced off Meppen-Walter and fell at the feet of Elliott. He made it two goals in two minutes when he thundered an unstoppable shot into the roof of the target.
Carlisle suddenly had work to do but they couldn't make it happen in the opposition final third as Meppen-Walter, O'Hanlon and Guy challenged for crosses. Potts and Noble had shots blocked from distance and it became frantic as the visitors threw men forward and left space at the back.
Half chances came and went but neither keeper was further troubled and it was the Robins who were left to celebrate come the final whistle.
Bristol City - M Elliott (68, 70)
United - Potts (35)
Bristol City - El-Abd (42), Pack (90)
United - Potts (90)
Bristol City - Moore, Williams (Burns 46), Flint, W Elliott (M Elliott 46), Baldock, Emmanuel-Thomas, Wagstaff, Reid (Barnett 65), Cunningham, El-Abd, Pack. Subs - Fielding, Moloney, Bryan, Gillet.
United - Fleming, Chimbonda, O'Hanlon, Meppen-Walter, Robson, Ekangamene (Symington 90), Potts, Noble (Guy 73), Berrett, Drennan (Byrne 77), Amoo. Subs - Bouzanis, Brough, Dempsey.
Referee - Mr Trevor Kettle
Attendance - 11,029 (343 away fans)