Sergio Aguero netted in stoppage time to give quadruple-chasing Manchester City a 2-1 victory over Bristol City in the first leg of their English League Cup semifinal on Tuesday.
Despite leading the Premier League by 15 points, Man City was given a stern test by the second-tier visitors who took the lead through Bobby Reid's penalty in the 44th minute.
After Kevin De Bruyne's well-worked 55th-minute equalizer, Man City had to wait until the substitute Aguero headed in Bernardo Silva's cross to ensure Pep Guardiola's side has the edge going into the second leg in two weeks in southwest England.
"(We're) disappointed to concede late on but we can hold our heads high," he told broadcaster Sky Sports. "We played very well today, could have had a couple more goals but we pushed probably the best team in the world all the way.
"We're still in the contest. We're disappointed but we're looking forward to the next game."
The gulf in status between the sides wasn't always obvious.
Bristol City attacked with pace and confidence. Joe Bryan, who scored a spectacular goal in the quarterfinal win over Manchester United, was often leading the charge at Etihad Stadium.
Hordur Magnusson's long throw-ins also proved troublesome for the hosts to handle with one delivery into the box eventually falling for Jamie Paterson to shoot. City defender John Stones blocked.
Bryan tried his luck himself after De Bruyne lost the ball, and Marlon Pack also hit a shot from the edge of the area but Man City goalkeeper Claudio Bravo saved both efforts.
Man City was not at its incisive best with Aguero on the bench and Raheem Sterling, Bernardo Silva and Leroy Sane switching roles across the attacking line.
Openings did come, however, with Sane twice bringing goalkeeper Frank Fielding into action and De Bruyne also having a shot tipped over.
Ilkay Gundogan also missed the target twice and Silva badly miscued in front of goal as Man City couldn't find a breakthrough.
Then before halftime, Man City defender Eliaquim Mangala lost the ball to Josh Brownhill. Reid took up the attack and was brought down in the area by Stones.
Bravo did get his fingers to the resulting spot kick but the goalkeeper could not keep out Reid's firm strike.
That spurred Man City into life and Sterling looked set to level before the break when he lifted over the advancing Fielding but Aden Flint scrambled back superbly to head off the goal-line.
Bravo launched the quick break that led to the equalizer with a pass that found De Bruyne in a huge amount of space.
The Belgian did not pass up the invitation and charged the length of the field before exchanging passes with Sterling and thumping home the leveler.
Fielding needed to save well to repel Sterling before Sane shot wide.
Bristol City sat back, getting bodies behind the ball at every opportunity to cling on for a draw. It almost worked but Aguero had the final say on the night two minutes into stoppage time.