The League Two side, 72 places below City in the football pyramid, looked set to pull off one of the biggest modern-day FA Cup shocks after taking a second-half lead.
But City, prompted by the inspirational Phil Foden, scored three times in the last ten minutes through Foden, Gabriel Jesus and Ferran Torres to navigate the trickiest of ties at the Jonny-Rocks Stadium.
City were almost in front after just 24 seconds as Riyad Mahrez’s superb pass put Gabriel Jesus in behind the Cheltenham defence but the Brazilian’s attempted lob was tipped away by Robins keeper Josh Griffiths.
The hosts went close themselves immediately with Alfie May inches away from connecting with a near-post cross in a bright opening to the game.
Benjamin Mendy thought he’d broken the deadlock on 12 with a thunderous effort from just inside the box but Cheltenham skipper Ben Tozer somehow managed to head off the line.
There was no hint of frustration in City’s play with Cheltenham well-organised and committed in the challenge.
With so many changes to the starting line-up, it was always going to be a more workmanlike City performance, particularly in the first-half which was held up for five minutes as a mini firework display behind the stand saw the referee briefly suspend the action.
The half ended goalless, with the League Two side holding their own and gradually growing in confidence.
It was the best chance of the game, but with one goal in 12 games, Jesus' confidence in front of goal isn't at its highest.
Then, just before the hour-mark, the sting from the hosts as one of Tozer's long throws caused confusion and Alfie May was first to the loose ball, firing high into the roof of the net from a few yards out.
Halifax, Shrewsbury Town... would Cheltenham Town be added to the list of cup shocks City have suffered over the years?
With half-an-hour to play, there was time to save the blushes.
Then, finally, with the clock ticking into the last 10 minutes, Foden - our best player on the night - followed sub Joao Cancelo's cross into the box before volleying home from close range.
The relief was palpable.
Two minutes later, City were ahead.
Patient play again by a City side who had refused to panic ended with Fernandinho picking out Jesus' clever movement and the Brazilian chested the ball down before spinning and volleying home from eight yards.
It was quite a turnaround.
what it means...
City face Swansea in the FA Cup 5th Round.
The match will be held at The Liberty Stadium with the last 16 ties provisionally scheduled for 10 February
"Cheltenham impressed me. They were compact; how they communicate how they fight for each other – we knew it – when you have a lower league side who play at home and we play away, it’s normal because it has happened many times in this competition,
"But we had the chances one against one we saw how they opened after our second goal – the game could have been completely different had we scored earlier and the game would be totally different.
"I know from my experience when we played Newport two years ago and we won in the last minutes of the second half were tough and against Wigan who knocked us out so we know the FA Cup and that’s why it is nice that every team can beat anyone
"But it is about our response in 90 minutes - at 1-0, I didn’t have any regrets about the way we were playing or behaving and fortunately the talent from the cross from Joao the exceptional finish from Gabriel and Phil – the goals were excellent.
"I am happy we are through and now Swansea."
City travel to West Brom in the Premier League on Tuesday (8:15pm kick-off) knowing victory will mean top spot in the table – at least for 24 hours ahead of Manchester United’s game against Sheffield United.
And the struggling Blades will then take on City next Saturday (3pm) at the Etihad in the Premier League.
Cheltenham Town:: Griffiths, Raglan, Tozer (C), Boyle, Blair, Freestone, Thomas, Clements( Addai 89), Azaz, (Williams 81) ,Lloyd (Long 69), May.
Subs: Flinders, Harris, Bowry, Ebanks
News about Cheltenham v Man City
Cheltenham 1-3 Man City: Reaction and match stats
Cheltenham 1-3 City: Match highlights
The best of the action from the Jonny-Rocks Stadium... Watch more.
Cheltenham Town 1-3 City: Full-match replay
Watch the entire 90 minutes of Manchester City's 3-1 win over Cheltenham Town in the FA Cup fourth round. Watch more.
Foden on cloud nine after vital FA Cup strike
Phil Foden said he was determined to keep working and seeking to improve after his ninth goal of the season helped guide City to a battling 3-1 FA Cup fourth round win at Cheltenham Town. Read more.