With six minutes left and a three-goal lead to take care of Rochdale got a fright in the closing stages after sub Neale Fenn and Andy Clarke had each scored a goal to make Dale's lead look a bit precarious.
And so it was as the Posh battled away for that equaliser which it seemed at one time only a miracle could produce. There nearly was a miracle as Fenn and then Clarke both went very close to getting an equaliser in injury time.
The Rochdale defence held out and with the crowd whistling to the ref to blow for time, the ref produced the goods to the great relief of beleaguered Rochdale.
Peterborough did not show up well in the first half and manager Barry Fry said: "Our defending was poor, but we improved after the interval and at only two down I felt we were in with a chance.
"When Rochdale got their third it was going to be a hard uphill struggle." Rochdale were off to a great start when Paul Connor got their first after three minutes. He fastened on to a through ball from midfield and beat the goal keeper from six yards with a low right-foot shot.
Nine minutes later there was more trouble for Peterborough when Clive Platt met Paul Simpson's corner at the near post and turned the ball into the net with his head.
It was a corner again by Simpson which produced number three with an unmarked Chris Beech heading home.
After that Peterborough improved and they were able to frighten the life out of Rochdale with their late rally.
Another five minutes and they could have forced the replay and even won.
For they had the home defence surrounded and depending a lot on their good luck and Peterborough's bad shooting to survive