Manchester City are through the FA Cup fifth round but only after surviving a major scare against third-tier Leyton Orient on Saturday.
The Premier League side fell behind in remarkable fashion in the 16th minute when Jamie Donley's shot from 50 yards out stuck the crossbar before hitting goalkeeper Stefan Ortega and bouncing over the line.
An almighty shock looked on the cards until City managed to level the scores 11 minutes after half-time thanks to an outrageous slice of luck.
A short-corner routine ended up at the feet of Rico Lewis and his strike hit the back of the net after a wicked deflection off substitute Abdukodir Khusanov's back.
Another City substitute would score what turned out to the winner with 11 minutes to go. Jack Grealish sent a lovely ball through to Kevin de Bruyne and the Belgian playmaker clipped a lovely finish past Josh Keeley from a tight angle.
There was still time for Orient to miss a glorious chance to level in injury-time when Dan Happe was left unmarked at the back post from a free-kick only for the centre-half to send a volley over the bar.
It was a cruel end for Happe and the League One side who might have fancied their chances in extra-time against a City defence that has struggled this season.
“We played a really good game, it was a typical FA Cup game – that's why this competition is unbelievable,” said City manager Pep Guardiola.
“We knew that they were strong and they'd run in the channels. They are a really good team and incredibly well managed but we created a lot of chances. I'm happy to go through.”
City started with a strong line-up at the Gaughan Group Stadium that included January signings Nico Gonzalez and Omar Marmoush, as well as experienced heads such as Iklay Gundogan and Jack Grealish.
But Guardiola did leave the likes of Phil Foden, Bernardo Silva and De Bryune on the bench, while top-scorer Erling Haaland was rested completely ahead of the Uefa Champions League play-off first-leg against Real Madrid on Tuesday.
And the visitors should have taken an 11th-minute lead when Gundogan's footwork let him down as he managed to miss-hit a low cross wide of the target from just six yards out.
But Orient were certainly not overawed by the occasion with Charlie Kellman missing a chance not long after when managed to force a save from Ortega despite being let down by a poor first touch.
But there nothing wrong with Donley's touch a minute later as Orient took the lead with a goal that will go down in FA Cup folklore.
City debutant Gonzalez was caught in possession near the halfway line, although there was a strong argument that the Spanish midfielder might have been fouled by Sonny Perkins in the process.
But there was no hint of what was to come as Donley looked up and saw Ortega off his line before sending a pinpoint effort on to the bar and into the net via the German keeper, sparking wild celebrations on the pitch and in the stands.
Despite his wonder strike being given as an own-goal, Donley's memorable day continued when he cleared Silva's effort off the line. The Portuguese had replaced the injured Gonzalez who had been given a brutal introduction to English football.
Striker Marmoush should have levelled in first-half injury-time when he was left unmarked in the box but the Egyptian's volley was too close to Keeley who saved well.
City started the second half strongly and it was no surprise when the equaliser came.
Half-time introduction Abdukodir Khusanov endured a nightmare debut against Chelsea in the league but will be delighted to score his first goal for City, albeit one that he knew little about after deflecting Lewis's effort into the net.
City were now well on top as first James McAtee went close with a first-time shot which hit the post, then Gundogan was denied a goal when his deflected effort from outside the box was saved by Keeley.
Guardiola, though, was then able to send on the cavalry in De Bruyne and Foden and it was the former who scored with a clever finish to send City into the fifth-round draw.
And while Orient defender Happe will be having nightmares about that late miss for years to come, manager Richie Wellens insisted he was proud of his team.
“I'm proud because we created chances, we caused them problems, the atmosphere was brilliant,” said Wellens, who started his playing career at City rivals Manchester United.
“The goals are so obvious for us. Their wingers were staying high and wide and causing problems. I'm disappointed with the last goal. At least it took the big boy to come on and beat us.”