Substitute Sergio Aguero scored twice late on to pair with a slick Bernardo Silva finish as Pep Guardiola's charges overcame a two-goal first-half deficit to top the south Wales side 3-2 at the Liberty Stadium.
Silva beat Kristoffer Nordfeldt with a sublime close-range finish in the 69th minute to cut Swansea's lead in half amid a period of unrelenting pressure from the visitors. A second goal seemed inevitable. Step up substitute Aguero, who was the beneficiary of a fortuitous bounce when his spot-kick ricocheted off the post before deflecting off the 'keeper's heel and in.
Fortune favored the top-tier behemoths, and the Championship side will feel aggrieved after Aguero's penalty resulted from a questionable foul on Raheem Sterling before the Argentine appeared a yard offside on the match-winner.
Sadly for the Swans, there was no VAR at their disposal after an FA ruling mandated that the video replay technology be used only at Premier League grounds.
Swansea were good value for a victory following a thrilling opening 45 minutes. Matt Grimes gave the hosts a 20th-minute lead from the penalty spot before former City academy product Bersant Celina carved the Premier League leaders apart with a slick run and finish.
City now advance to the semifinal stage alongside Watford, who progressed courtesy of a 2-1 home win over Crystal Palace earlier Saturday. Manchester United visit Wolves later in the day, with Millwall and Brighton set to determine the last semifinalist on Sunday at The Den.