Just when it seemed that Tranmere Rovers had booked a third round FA Cup tie at Premier League side West Bromwich Albion, Aaron McLean popped up with an equaliser for Posh in the fourth minute of added time.
The breakthrough for the Merseysiders in a tense affair came in the 47th minute via skipper Antony Kay.
But United never gave up the fight and after three times being denied by the woodwork, they deservedly took the game into extra time and went on to win.
There was little adventure early on with neither keeper tested until the 29th minute.
United's McLean got in the first strike after 15 minutes but failed to trouble Danny Coyne from 20 yards.
Another effort was well over before Kay brought a safe catch from Joe Lewis with a low drive from 25 yards.
Then Bas Savage was only just off target from the edge of the box.
As Tranmere pressed towards the break, Steve Jennings fired wide and Ed Sonko was blocked out from a good opening.
The Merseysiders grabbed a crucial goal two minutes into the second-half.
Posh were found wanting in defence as Kay headed home from an Andy Taylor corner.
As the visitors rallied, Danny Coyne saved well from McLean's angled strike.
But the keeper was lucky in the 60th minute when a McLean shot from just outside the box rebounded off a post.
It was Coyne again keeping Rovers ahead with a great one-handed stop from McLean, before Craig Morgan headed just wide from the subsequent corner.
Sub Dominic Green rattled the crossbar with a 73rd minute free-kick for United and then Boyd was denied by a post with a 25-yard strike.
At the other end, Chris Shuker hit the bar for Tranmere on 84 minutes.
But just when it looked all over, Charlie Lee provided the opportunity for McLean to stab home from close range in the fourth minute of stoppage time for Darren Ferguson's never-say-die outfit.
Craig Mackail-Smith blasted the winner from 12 yards as a Lee shot appeared to be going wide on 114 minutes.