Pompey Academy booked their place in the second round of the FA Youth Cup, but had to battle from behind to see off Didcot at Fratton Park.
Goals from Connor Barrett and Tyler Webb for the visitors meant an upset was on the cards when the sides went in at the break.
But the Blues improved in the second and immediately found a route back into the contest when Harvey Rew arrived at the near post to glance home a corner.
Their Oxfordshire opponents appeared to be hanging on, however, and there were just six minutes remaining when a long-range shot from Kristian Dawson (pictured) rocketed into the net.
And the turnaround was complete in the final moments of normal time, as Harrison Brook stole possession and squared for Seok Jae Lee to convert.
There was still time for Brook to get on the scoresheet himself, though, courtesy of an effort that squirmed under the keeper after being teed-up by Dan Gifford.
Pompey will now hosts the winners of the tie between Bromley and Bedfont Sports Club in the second round.
Professional development phase coach Liam Daish said: “Didcot came out of the blocks extremely quickly and pressed us very well.
"To be fair to them, they showed a bit of character and resolve to fight back and get through to the next round."
“That put us on the back foot and before we knew it we found ourselves two goals down at home. We were a bit shell-shocked and they deserve a lot of credit for that.
“I was glad to get the boys in for half-time, so we could try to get a plan together to go on and win the game.
“To be fair to them, they showed a bit of character and resolve to fight back and get through to the next round.
“We warned our players not to underestimate the opposition because it was always going to be a big match for them at Fratton Park. They were going to be up for it.
“It’s a new experience for our lads as well, though, and it’s something that will certainly stay with them.
“We need to learn to make better decisions because we’ll be facing another non-league side in the next round.”
Pompey: Manderson; Setters, Kaba, Cadman, Hughes; Bell, Rew; Brook, Lee, Bridgman (Dawson 74); Anderson (Gifford 74)
Subs not used: Steward, Dockerill