Man City survive huge FA Cup scare against Cheltenham
Six-time winners City were less than 10 minutes away from going out at the fourth-round stage before goals from Phil Foden, Gabriel Jesus and Ferran Torres.
City boss Pep Guardiola made 10 changes for the trip to the League Two side but his side was still packed with internationals.
The home team -- 72 places below City in the English football pyramid -- produced a stirring defensive display to keep their much-vaunted opponents at bay.
Then, minutes after Jesus had hit the post in the second half, they took the lead.
City failed to deal with the outstanding Ben Tozer's long throw and Alfie May fired in from close range to spark celebrations among the players.
Riyad Mahrez should have equalised when put through by Foden but Josh Griffiths produced a fine save to keep his side's lead intact.
City were finally level when Foden levelled with nine minutes left, volleying in Joao Cancelo's cross.
Three minutes later Jesus increased City's lead, beating the offside trap to fire in from Fernandinho's dinked ball over the centre-backs.
Torres made it 3-1 with the final kick of the game, turning in Ilkay Gundogan's low cross.