The home side took a first-half lead in spectacular fashion after Stefan Ortega Moreno deflected a long-range chip into his own net.
The League One side were punching well above their weight and deservedly led at the break, but City fought back after the break with goals from Abdukodir Khusanov and Kevin De Bruyne to progress to the FA Cup 5th round.
City will have been well aware of Leyton Orient’s high press and in-your-face style, but dealing with it on a tight pitch with a sell-out and excitable home crowd’s backing is a different proposition.
The in-form League One outfit posted early warnings with a number of attacks down the left and dangerous balls into the box.
There was little or no time for the Blues to settle as the tackles flew in, with the hosts clearly fancying their chances of a cup upset against the Premier League champions.
But having survived that early pressure, City should have taken the lead on 10 minutes as a delightful chip from Nico found Savinho in the box and his first-time cross to Ilkay Gundogan should have been converted by the German, but he seemed to get his feet tangled at the crucial moment and instead put the ball harmlessly wide.
The in-form League One outfit posted early warnings with a number of attacks down the left and dangerous balls into the box.
There was little or no time for the Blues to settle as the tackles flew in, with the hosts clearly fancying their chances of a cup upset against the Premier League champions.
But having survived that early pressure, City should have taken the lead on 10 minutes as a delightful chip from Nico found Savinho in the box and his first-time cross to Ilkay Gundogan should have been converted by the German, but he seemed to get his feet tangled at the crucial moment and instead put the ball harmlessly wide.
The Blues gradually started to play the more controlled football and began to find gaps and opportunities.
Jack Grealish found Bernardo at the back post, but Donley was on hand to clear his volley off the line on 37 minutes.
Three minutes into added time, there was an ever better opportunity to level the scores as Savinho’s fine cross found the unmarked Omar Marmoush, but the Egyptian’s volley was easily saved by keeper Josh Keely.
Pep Guardiola made two more substitutions with Abdukodir Khusanov and John Stones brought on for Ruben Dias and Vitor Reis.
And Khusanov was called into action almost immediately with a superb toe-end touch as a cross came in from the right and would surely have been converted by the Orient forward he nicked it away from.
And the young Uzbeki demonstrated the highs and lows of football 10 minutes later.
The youngster, whose mistake led to a Chelsea goal on his debut , saw a Rico Lewis shot glance off his head to wrong-foot Keely and level the scores on 57.
There was no denying it was a huge slice of luck, but perhaps one Khusanov deserved.
And just past the hour, City felt a penalty should have been awarded as McAtee’s clever pass found Marmoush who, as he tried to roll his marker, seemed to have his legs taken away.
The referee, with no support from VAR which is not operational in this round, and nothing was given.
Orient still looked a threat going forward, with a couple of good opportunities reminding the Blues there was still hard work to be done.
But Real Madrid to come in three days, Guardiola wanted the game settled in normal time and so sent on De Bruyne and Phil Foden with 20 minutes to go.
It was heading towards an edgy finish as both sides attacked and looked threatening.
Increasingly, it felt whoever scored the next goal would go on and win the game.
And on 79 minutes, it seemed the Blues had done just that.
Grealish held the ball on the left before picking out De Bruyne’s dart into the box and as Keely hesitated, the Belgian toed a shot beyond in him and into the net to make it 2-1.
There were half-chances at either end in the time that remained, but City held out to move into the last 16 of the competition – but the home side could not have given much more in this absorbing contest.