Title-chasing Pompey were made to work to secure a 1-0 win at Mansfield.
Carl Baker’s second-half strike ensured the Blues travelled back to Fratton Park with all three points.
And with Doncaster losing 3-1 to Exeter, Pompey now have hope of lifting the League Two title on the final day of the season.
The hosts started off the better of the two teams.
In the fourth minute Rhys Bennett should have done better with his effort after a goalmouth scramble as his shot was straight into the arms of David Forde.
Five minutes later, Enda Stevens fouled Joel Byrom 30 yards from goal, but Alex MacDonald’s right-foot shot sailed over the crossbar.
Pompey finally had an effort on goal after 27 minutes.
Stevens spotted Conor Chaplin’s intelligent run but the striker could not control his effort and Stags keeper Jake Kean easily saved.
Forde was then alert to rush off his line twice for Paul Cook’s men.
He first distracted the Stags’ Danny Rose when he was set free down the left in the 29th minute.
Five minutes later, Shaq Coulthirst was away after Michael Doyle gave the ball away, but the Blues keeper was again out to force the Mansfield striker wide.
Pompey finally got into the game as the half-time whistle approached.
On 36 minutes, Kal Naismith drove into the box from the right and his effort was saved by Kean.
One minute before the break, Gareth Evans was brought down and took his free-kick quickly.
He found Kyle Bennett, and after a clever nutmeg, hit his left-foot shot down the throat of Kean.
The Stags started out the better again in the second period and Matt Clarke was given a lifeline.
He miscontrolled a pass and Mansfield’s Danny Rose won the ball.
The defender then brought down the Stags striker and was the last man, but referee Lee Swabey only issued a yellow card.
Four minutes later, Rhys Bennett turned the ball into the net from close range after Alex MacDonald’s effort was blocked by Christian Burgess - but the goal was disallowed for offside.
Against the run of play, Pompey took the lead in the 56th minute.
Naismith found Carl Baker in the box, who swivled well and his right-foot shot went through Kean.
After the opener, the home side continued the pressure.
Shaq Coulthirst beat Pompey’s offside trap when Mal Benning played him and was one-on-one with Forde but chipped his effort over.
Cook brought on Jack Whatmough and Stanley Aborah to protect his side’s lead.
And late on Naismith had a chance to wrap the game up but his effort went over.