It looked as though Pep Guardiola's attempt to win all four trophies would end on a rainy evening in South Wales when Swansea took a shock 2-0 lead through a Matt Grimes penalty and a stunning team goal finished off by former City player Bersant Celina.
However, Bernardo Silva sparked the comeback 20 minutes from time before a controversial penalty and a late Sergio Aguero winner - neither of which would have stood with the aid of VAR - completed a memorable turnaround.
It was a heartbreaking end for Swansea, who fought so valiantly on home turf, but Man City progress into the semi-finals of the competition and remain in the hunt for a clean sweep of silverware this term.
The visitors - fresh from scoring seven past Schalke 04 in the Champions League on Tuesday night - unsurprisingly began the match on top and the early stages suggested that it may again be a question of how many they would score.
Leroy Sane was the first to threaten when he skipped past his marker before stinging the palms of Kristoffer Nordfeldt, and Riyad Mahrez should have tucked the rebound home when he nodded the ball narrowly wide of an unguarded net.
Nordfeldt was called into action again shortly afterwards when Sane this time stood the ball up to the back post, but Bernardo could only scuff his volley into the ground to make things a little easier for the keeper.
Swansea had created one or two good attacking platforms which they were unable to take advantage of in the opening 20 minutes, but they were gifted the chance to take a shock lead when Fabian Delph rashly brought Connor Roberts to ground inside the area.
Grimes almost turned from hero to villain when he gave possession away cheaply moments later, but Man City's failure to make the most of a promising situation was symptomatic of a first-half performance during which they were far short of their ruthless best.
Most would have still expected the English champions to recover from a one-goal deficit, but Swansea doubled their advantage just before the half-hour mark to leave City's quadruple dreams in serious jeopardy.
It was a team goal Man City would have been proud of themselves too, with the hosts playing it from the keeper and slicing through their illustrious opponents before Celina applied the finish it deserved by curling the ball past Ederson.
Suddenly Swansea were brimming with belief, and Roberts curled another effort wide moments after the second as they looked to put their visitors to bed inside the first half.
Man City continued to create chances themselves, though, and Nordfeldt kept out a driven Bernardo half-volley before Roberts produced a stunning block on his own line to deny David Silva what looked like a certain goal from just six yards out.
At that stage it looked as though nothing would fall for City, and their frustration was plain to see as Aymeric Laporte was shown a yellow card while leaving the field for half time following an altercation with Wayne Routledge.
Swansea continued to get the rub of the green after the restart too, with a Roberts clearance hitting Gabriel Jesus and flying narrowly past the post less than two minutes into the second half.
Nordfeldt's goal was a lot less endangered for much of the second half, though, as Swansea managed to keep Man City at bay and offer regular threats through the impressive Celina and lightning-quick pace of Daniel James.
Guardiola called upon Raheem Sterling and Aguero off the bench to turn the tide, and the visitors pulled a goal back with their first real chance of the second half within five minutes of the latter's introduction.
Aguero was heavily involved too, seeing his initial shot bravely blocked by Jay Fulton before picking up the loose rebound and teeing up Bernardo, who produced an exquisite finish with the outside of his boot.
Sterling blazed over shortly afterwards, but by this stage Man City's pressure was relentless and they finally found the equaliser 11 minutes from time - albeit in hugely controversial circumstances.
Sterling went down under the challenge of Cameron Carter-Vickers inside the area and Andre Marriner rather tentatively pointed to the spot, despite replays showing that the Swansea defender got a crucial touch on the ball.
An FA rule prevented VAR from being in use due to the Liberty Stadium being a Championship ground, despite the venue having all the requirements and utilising the video official when Swansea were in the Premier League last season.
Had VAR been in play then the decision would have been overturned, and Swansea knew that their luck had truly run out when Aguero's resulting spot kick struck the post before bouncing against the legs of Nordfeldt and over the line for an unfortunate own goal.
Still Swansea defended heroically in their attempts to hang on for extra time, with Fulton denying Bernardo before Nordfeldt pulled off a sensational double save, first turning Jesus's header onto the post before somehow throwing his legs in the way of Aguero's follow-up when the Argentine seemed destined to score.
Carter-Vickers was the next to thwart Aguero from point-blank range before Kyle Walker dragged a long-distance strike wide, but such heavy pressure finally told with just two minutes remaining of normal time as City completed the comeback.
Once again there was an air of controversy about it, though, as Aguero appeared to be standing in an offside position before meeting Bernardo's cross with a diving header into the bottom corner.
There was no time for Swansea to respond as they fell to a defeat which will be difficult to take, leaving Man City still on course for the quadruple.
SWANSEA (4-4-2): Nordfeldt; Roberts, Van der Hoorn, Grimes, Carter-Vickers; Dyer (Asoro 61'), Fulton (Harries 86'), Byers (John 73'), James; Routledge, Celina
MAN CITY (4-3-3): Ederson; Walker, Otamendi, Laporte, Delph (Zinchenko 57'); Bernardo, Gundogan, D Silva; Mahrez (Aguero 64'), Jesus, Sane (Sterling 57')
body check tags ::