Ellis Harrison headed home in stoppage-time to dramatically earn Pompey a first away league win of the season.
A goal on the break from Gareth Evans in the second half had earlier given the visitors the lead at the Keepmoat Stadium.
Doncaster twice struck the woodwork and looked to have salvaged a point when Reece James bundled in a leveller.
They were chasing a winner, but instead finished with nothing, as Harrison deftly guided the ball into the net at the death.
Kenny Jackett made three changes from the side that had beaten Bolton on home soil earlier in the week.
Lee Brown came straight back into the starting line-up after recovering from an Achilles injury, while there were also returns for Evans and Marcus Harness out wide.
Brandon Haunstrup and Ryan Williams both dropped to the bench, but there was no place in the matchday squad for Ronan Curtis because of a tight hamstring.
Pompey kept with the same 4-4-2 system that had helped them secure all three points against Wanderers, with Brett Pitman utilised alongside former Rovers striker John Marquis.
Neither side created much in the opening stages on a grey afternoon in south Yorkshire, although that did not stop the travelling faithful for being in fine voice.
Shots at either end for first Ben Whiteman and then Marquis lacked enough power to trouble the respective goalkeepers.
But it was Doncaster who found their feet quickest and Alfie May’s shot from nothing cannoned against the crossbar.
Craig MacGillivray then head to come tearing from his line to stop Jon Taylor after the winger had burst in from the left.
Rovers were looking particularly threatening on the break and Harness hacked clear after one dangerous counter-attack.
The visitors collected a couple of bookings, with Tom Naylor punished for a late challenge on May and Harness seeing yellow after catching Whiteman with a flailing arm.
Doncaster had their best chance of the half in between, when Kieran Sadlier was left unchallenged to charge in and meet James Coppinger’s delivery, only to send the ball wide from a few yards out.
There were a couple of opportunities at the other end, though, and Evans’ cross was just too high for Pitman in the box.
The striker tried to return the favour after beating his man on the right, but Seny Dieng came off his line to just about get there first.
Doncaster Rovers 0
There was a change at the start of the second half, with Marquis not emerging from the tunnel and fellow summer signing Harrison replacing him.
But it was the hosts who were first to have an opening following the restart, with MacGillivray getting down to his left to keep out Whiteman’s fierce drive.
James Bolton was then fouled by Kieran Sadlier in the race for the loose ball and required treatment, but was fine to continue.
MacGillivray was soon called into action again, although not overly troubled by Coppinger’s long-range attempt.
And the stopper had to adjust his feet to make an ultimately comfortable save when Sadlier’s effort deflected off Sean Raggett.
But it was the noisy 1,351 travelling fans who were celebrating the opening goal, which came against the run of play on the hour mark.
A clearance was collected by Ben Close in the middle of the pitch and he slid a pass across for the charging EVANS.
The midfielder was able to race through on goal and neatly slot home past Dieng before wheeling away to celebrate.
A stunned Rovers tried to hit back, but a corner was dealt with by Harrison and Whiteman’s 25-yard shot received a deflection to divert it off target.
And another Blues counter-attack almost led to the lead being strengthened, as Close’s curler from the edge of the box had to be expertly palmed over by Dieng.
The visitors were having to work hard at the other end, though, and the imperious Christian Burgess did well to block Taylor’s strike, with the ball looping wide of the post.
Doncaster went even closer to levelling soon after, courtesy of a thunderous shot from Whiteman that rattled the crossbar.
Pompey were looking solid at the back, but the hosts finally made their pressure count on 82 minutes.
An angled cross-shot from May was parried away by MacGillivray and James reacted quickest to force home the loose ball.
Williams had been waiting to come on in the build-up to that goal and immediately replaced the tiring Harness.
Rovers were looking to grab a winner and Whiteman’s effort from the edge of the box just about cleared the crossbar.
But it was the Blues who instead secured all three points when, in stoppage-time, HARRISON met Bolton’s cross and sent a fine header looping over Dieng and into the net.
There were still some nervy moments to contend with, however, and a collective sigh of relief greeted the final whistle.
Doncaster (4-2-3-1): Dieng; Halliday, Anderson, Daniels, James; Sheaf, Whiteman (c); May (Wright 90+4), Coppinger, Taylor; Sadlier
Goals: James 82
Subs not used: Lawlor, Amos, Greaves, Gomes, Longbottom, Kiwomya
Pompey (4-4-2): MacGillivray; Bolton, Burgess, Raggett, Brown; Harness (Williams 82), Close, Naylor (c), Evans; Marquis (Harrison 46), Pitman
Goals: Evans 60, Harrison 90+1
Booked: Naylor, Harness
Subs not used: Bass, Walkes, Downing, Haunstrup, McCrorie
Referee: Andy Haines
Attendance: 8,962 (1,351 Pompey fans)