A goal in stoppage time by Sergio Aguero saved Manchester City's blushes as it was enough to secure a 2-1 win over second-tier Bristol City in their League Cup semi-final first leg clash on Tuesday.
The Argentinian's 19th goal of the season and a fine effort by Belgian international Kevin De Bruyne cancelled out Bobby Reid's first-half penalty to give the hosts a club record-equalling 16th successive home win.
However Bristol City, this season's giantkillers who have eliminated four Premier League sides including holders Manchester United, gave their 8,000 travelling fans -- the highest away attendance at the Etihad Stadum in its 15-year history -- much to cheer.
Manchester City manager Pep Guardiola sportingly congratulated his Bristol City counterpart Lee Johnson at the end.
"We created a lot of chances and that's why we win in the end, but today we knew we are not going to finish our job -- that will have to happen away in Bristol when we travel there," the Spaniard told the BBC.
"They were really good, so we tried so hard, all the players tried and we're really happy," added the 46-year-old, who has lost five of his last six semi-finals including City's last domestic loss to Arsenal in last season's FA Cup.
Johnson, who last season received a death threat and had to move house as a result after Bristol City lost eight matches in a row, said he was proud of his players.
"They can't be disappointed as we are still in the tie," he told Sky Sports.
"They have shown the world we are good footballers."
Manchester City went close to breaking the deadlock on the quarter-hour mark when a flowing move concluded with Bernardo Silva's goal-bound shot taking a deflection off a Bristol City defender.
Stones upends Reid
The visitors, though, were not in the least intimidated and went close themselves immediately afterwards, Claudio Bravo saving Joe Bryan's long-range shot.
Bristol City -- appearing in their first major semi-final in 29 years -- were more than holding their own but a poor clearance saw De Bruyne force a good one-handed save from Frank Fielding as the hosts pressed for the opener.
The hosts turned the screw as the half progressed forcing a series of corners but without the end reward.
However, it was Manchester City who cracked in the 43rd minute as the shaky Eliaquim Mangala was dispossessed and John Stones made a rash challenge on Reid to concede a penalty.
Reid dusted himself off and although Bravo guessed the right way and got his fingers to the penalty, he was unable to prevent it going into the net for the scorer's 14th goal of the season.
Aden Flint ensured the Championship side went into the break 1-0 up when he produced a superb header to clear over his own bar as Raheem Sterling's shot looked destined to bring the sides level.
However, there was nothing the visitors could do about the equaliser in the 55th minute.
De Bruyne surged forward playing it to Sterling who laid it back to him and the Belgian rifled the ball into the net to provoke a sigh of relief from players and home fans alike.
Guardiola decided to send on his only out-and-out striker Aguero for Yaya Toure with 20 minutes remaining and the club's record goalscorer did not disappoint, firing in the winner for a barely deserved victory.