Bristol City, who currently sit third in the Championship table after a remarkable revival over the last 12 months, made just the one change from the team who beat Nottingham Forest 2-1 at the weekend; with Luke Steele replacing Frank Fielding in goal.
United rattled the woodwork for the second time in the 20th minute. With Marcus Rashford given too much time and space outside the Robins' box; the youngster's ripping strike crashed against the post with Steele well beaten.
As the half entered its final ten minutes, City started to push forward more and were nearly rewarded with the opening goal. The ball fell to Magnusson who brushed off Rashford's challenge before unleashing a shot from the edge of the box which Romero managed to push away.
City would have probably taken the lead in the 41st minute if it weren't for a last-gasp challenge from Daley Blind. Smith found himself in a great position inside United's box following a Patterson backheel, just as Smith looked to pull the trigger Blind slid in from nowhere to clear the danger.
Five minutes after the restart and Bristol City took the lead. A lovely ball from Pack sent Bryan away on the left, the left wing-back then released an unstoppable shot which thundered across Romero and into the top corner.
Their lead didn't last for long however, and just five minutes later Ibrahimovic grabbed his first goal of the season. The Swede lined up a free kick from 25 yards out before drilling it low and hard through the wall and past Luke Steele.
With Bristol City still proving to be more than a handful for United, Mourinho decided to change things up with both Lukaku and
The striker had looked lively since his introduction and went close again in the 75th minute. Once again Luke Steele did well as he stuck out an arm to deny Lukaku's glancing header.
Steele made it a hat-trick of saves from Lukaku in the 83rd minute. The striker made his way into the box and drilled a low shot through a number of bodies and across goal, his shot looked to be heading for the bottom corner, until the excellent Steele once again managed to claw it away.
Amazingly, Bristol City regained the lead in the last seconds of the game. A Taylor cross from the left found an unchallenged Smith, who had time to turn and plant his shot across Romero and into United's net, sending Ashton Gate into delirium.
The referee blew his whistle soon after to confirm Bristol City's shock win. It was a courageous performance from the Robins who caused United problems throughout the 90 minutes, both with their constant harrying and with some quality bits of play. United were perhaps a little unlucky in the first half, with both of their efforts striking the woodwork. Nevertheless, Mourinho only has his players to blame after they missed a number of chances in the second half.