United boss Jose Mourinho has won the competition four times - more than any other manager - but tonight he lost a tie in normal time for just the second time in his career.
The earliest threat came from United when Anthony Martial delivered a pin-pointed cross to Ibrahimovic at the far post, but the Swede's effort from a tight angle bounced off the crossbar.
The Robins settled into the game quickly and tried to take the game to United by launching meaningful attacks when in possession, and they were awarded a handful of free kicks, which came to nothing.
Marcus Rashford came closest to scoring for the Red Devils in the first half when his attempt from long range clattered off the post as the ball was heading towards the bottom right corner.
The ball bounced off the back of the defender, who turned and send the ball into the back of the net, but the referee had already blown his whistle.
The hosts created chances as the half went on and tried to make the most of United failing to clear their lined when Magnusson forced a save from Romero, who leapt to his right to push the ball away from the net.
Daley Blind came to the rescue for United in the closing stages of the first half when his perfectly-timed tackle denied Korey Smith - who was through on goal - a shot inside the centre of the box.
After the break, Rashford came close to giving the visitors the lead with a free kick, which got a slight deflection on the way through and forced a save from Luke Steele.
The deadlock was eventually broken when Bryan scored for the hosts with a sweet strike that smashed past Romero and into the back of the net, which sent the home crowd wild.
The lead lasted for just seven minutes, though, as Ibrahimovic, who had a relatively quiet game up until then, struck a low hit from a free kick just outside of the box.
United almost suffered a blunder when Romero failed to punch the ball clear from inside the middle of the box, allowing Flint to head towards goal, but the ball bounced inches wide of the post.
Romelu Lukaku recently rediscovered his goalscoring form and he came close to nabbing the winner when Pogba delivered the ball into the box, but the striker's header was saved.
The visitors piled on the pressure as the minutes ticked by and they were denied a handful of times by the keeper, who in particular caused Lukaku some frustration.
Bristol City failed to give up, though, and they were rewarded for their efforts when the ball was lifted into the area for Smith, who smashed it home to give the hosts a dramatic victory.
Manager Lee Johnson was swarmed on the final whistle, as were his players when fans broke onto the pitch to celebrate.
Bristol City (4-4-1-1): Steele; Wright, Flint, Baker, Magnusson (Taylor 69'); Brownhill (Eliasson 74'), Smith, Pack, Bryan; Paterson; Reid
Manchester United (4-3-3): Romero; Darmian (Smalling 95'), Lindelof, Rojo, Shaw; Blind (Lukaku 61'), McTominay, Pogba; Rashford, Martial, Ibrahimovic (Mkhitaryan 69')