Andre Green scored at the death to see off Rochdale and send Pompey into the third round of the Emirates FA Cup.
Both sides had struck the woodwork in a Spotland contest that otherwise failed to ignite, with Ronan Curtis hitting the bar for the Blues.
But the visitors were unusually subdued after the break and a replay was looming until a deflected effort from substitute Green settled the tie.
Kenny Jackett made one change from the side that beat Walsall in the league earlier in the week.
Tom Naylor missed out with a slight groin problem, meaning that Ben Close was recalled to Pompey’s midfield.
Both sides took a while to hit their stride on a soggy Sunday afternoon in the north-west, with the keepers enjoying a quiet opening 45 minutes.
An Oli Hawkins header was deflected comfortably into the arms of Josh Lillis, while the Blues back-line dealt with a couple of deliveries into their box.
Jordan Williams should at least have tested Craig MacGillivray on 11 minutes, but fired wastefully wide after doing well to bring the ball under control.
The visitors began to look the more assured side, although efforts from Ben Thompson and Gareth Evans were off target and blocked respectively.
Pompey’s skipper went closer midway through the half, hitting a fierce and cleanly-struck volley narrowly over the crossbar.
There was plenty of neat build-up play on display, but they were too often let down by the final pass or shot.
And Jordan Williams might have made them pay at the other end late in the half, sending an attempt just past the post.
There was still time for two noteworthy moments for the Blues just before the sides went in for the interval.
Curtis smashed the ball against the crossbar and such was the ferocity of his effort, it came back to the Republic of Ireland international, who was unable to get a second shot away.
His fellow forward Jamal Lowe then went down in the box and despite the travelling fans appealing for a penalty, referee Seb Stockbridge instead booked him for diving.
Half Time: Rochdale 0 Pompey 0
A foul by Close gave Dale the first opportunity of the second half, but Matt Done’s free-kick struck the wall and was deflected behind.
The hosts then broke quickly up the pitch soon after, but MJ Williams’ shot was so high it flew out of the stadium.
Pompey had struggled to get going after the break and were perhaps fortunate not to have been punished for that.
There was certainly no lack of commitment, though, with Nathan Thompson’s fury at not being awarded a throw earning the right-back a booking.
Rochdale had another opening just past the hour mark when Calvin Andrew latched on to Ian Henderson’s pass, but MacGillivray saved with his feet.
And they went even closer on 69 minutes, as Done’s thunderous drive came back off the corner of post and bar.
A craning Hawkins saw his header saved by Lillis at the other end, as the Blues tried to pose more of a threat.
Brett Pitman – who has netted five times in the previous three meetings with Rochdale – provided an extra option on 72 minutes, with Evans making way.
But it was Jack Whatmough who missed a decent chance soon after, nodding wide after racing in to meet Lee Brown’s free-kick.
Jackett then made his second substitution, with Lowe withdrawn for Aston Villa loanee Green out wide.
It was Rochdale that were next to go close, however, as Henderson hit a sweet volley that dripped just over the Blues bar.
But, with a replay looking likely, Ryan Delaney brought down Green right on the edge of the box, earning the defender a yellow card.
Brown squared the free-kick to GREEN, whose shot took a wicked deflection to deceive Lillis and leave Rochdale reeling.
They almost levelled in stoppage-time, but MacGillivray denied Henderson from close range to ensure Pompey booked their place in the third round.
Rochdale (4-4-2): Lillis; Rafferty, McGahey, Delaney, Done; Dooley (Cannon 55), Adshead, M.Williams, Henderson (c); J.Williams, Andrew
Subs not used: Norman, McNulty, Rathbone, Perkins, Gillam, Inman
Pompey (4-2-3-1): MacGillivray; N.Thompson, Whatmough, Clarke, Brown; B.Thompson, Close; Lowe (Green 76), Evans (c) (Pitman 72), Curtis; Hawkins
Goals: Green 90
Booked: Lowe, N.Thompson
Subs not used: McGee, Walkes, Burgess, Haunstrup, Rose
Referee: Seb Stockbridge
Attendance: 2,555 (599 Pompey fans)