In a hard-fought fifth-round tie at London Road, the Championship side kept City at bay in the first half, with our play often disjointed and lacking rhythm.
But Riyad Mahrez produced a moment of quality to fire past Steven Benda and break the deadlock with an hour gone, before Phil Foden’s outrageous long-range pass set up Jack Grealish to score a second seven minutes later.
Joao Cancelo, Foden and Grealish all had chances to extend our lead but Peterborough stood firm, before Ayemric Laporte miscued from close range in added time.
With City top of the Premier League table and still in the UEFA Champions League, we retain an interest in three competitions with three months of the season remaining.
A fascinating end to the campaign beckons.
Starting XI: Benda, Edwards, Kent, Szmodics (Brown 71'), Grant, Knight, Poku (Marriott 71'), Jones (Clarke-Harris 71'), Ward (Mumba 79'), Fuchs, Coulson (Burrows 79')
Subs: Cornell, Beevers, Clarke-Harris, Brown, Marriott, Burrows, Corbett, Mumba, Barker
Starting XI: Ederson, Cancelo, Dias (Stones 46'), Ake (Laporte 46'), Zinchenko (C), Fernandinho, Gundogan, Foden, Grealish, Mahrez, Jesus
Subs: Carson, Slicker, Stones, Sterling, Laporte, Rodrigo, De Bruyne, Bernardo
A difficult night
This was, undoubtedly, a difficult night for the champions.
The first half saw City's play riddled with errors, our usual free-flowing football deserting us. Indeed, at half-time, the only shot on target was Jeando Fuchs' deflected shot, which was well saved by Ederson.
The second half started in much the same way, as Peterborough created a couple of half chances, while City remained below par.
But they say the sign of a great side is being able to win when not at optimum performance; the ability to grind results out on days when things don't quite click.
City did that on Saturday at Everton and again this evening in Peterborough.
Riyad Mahrez is having his best goalscoring season ever and his strike, which saw him fire home with minimal back lift, sparked City into life.
It was a much-needed moment of quality.
And Phil Foden followed suit, producing a quite brilliant pass to find Jack Grealish, whose touch and finish were perfect.
From there on in, City were much improved, but the first hour of this game was a real battle.
Before the game started, Fernandinho handed Oleksandr Zinchenko the captain's armband as an act of solidarity after a difficult week for the Ukrainian given the situation in his homeland.
Man of the match: Phil Foden
Hard work and extreme talent. Phil Foden is the perfect Guardiola player.
He chased every ball and fought to win back possession every time we lost it - and then when it mattered, he found a world-class pass to find Jack Grealish for our second.
What a player.
"Riyad always had this quality in the final third - he is the best we have in that area.
"He scored a fantastic goal. I am so proud for the game he played."
On Foden's pass...
"It’s unbelievable. It’s funny because before the game I was on the coach and I sit next to him and we were on Twitter and we saw a video of Messi's best passes.
"He came up to me after the goal and said it’s just like we were watching before the game. Just like Messi!"
In scoring the opener this evening, Riyad Mahez made it 19 goals in all competitions so far this term – his best return in any season of his career to date.
And City have now scored 80 goals in 28 FA Cup matches under the management of Pep Guardiola.
What it means
City are through to the FA Cup Sixth Round as our bid for three trophies continues apace.
The draw for the last eight will take place on Thursday at 19:45.
Ball numbers are below:
1. Luton Town or Chelsea
2. Crystal Palace
3. Manchester City
4. Liverpool or Norwich
5. Southampton or West Ham
7. Nottingham Forest or Huddersfield
8. Everton or Boreham Wood
Stay tuned to ManCity.com for news of who we are paired against.
Quarter-final matches will be played on the weekend of March 19.
It’s back to Premier League action on Sunday as we face Manchester United at the Etihad.
Games don’t come much bigger. With City top of the table, six points clear of second-placed Liverpool who have a game in hand, every single point is vital.
Kick off in the Manchester Derby is at 16:30 (UK).
And then on Wednesday, Sporting visit the Etihad for the second leg of our UEFA Champions League last-16 tie. City are, of course, 5-0 up from the first leg in Portugal.
That game gets under way at 20:00 (UK).
News about Peterborough v Man City"
City quality told in the end, says Guardiola
Pep Guardiola praised the special quality of City’s goals as we overcame the dogged challenge of Peterborough to seal our place in the FA Cup quarter-finals at London Road. Read more
Peterborough 0-2 City: Match stats and reaction
Pitcam Highlights: Peterborough 0-2 City
City moved through to the quarter-final stage of this season's FA Cup thanks to a 2-0 win at Peterborough. Watch more
Peterborough v City: Full-match replay
Watch the entire 90 minutes of Manchester City's FA Cup fifth round tie against Peterborough United on CITY+. Watch more