Match ends, Aldershot Town 1, Portsmouth 0.
Non-league Aldershot Town will play Rochdale in the second round of the FA Cup after Mark Molesley struck a late winner against League Two Portsmouth.
Jed Wallace almost broke the deadlock midway through the first half of the replay but his brilliant volley was saved by Shots keeper Phil Smith.
Molesley wasted a good chance for the hosts after the break when he headed wide while Dan Holman had a shot saved.
But Molesley bundled the ball home after a huge scramble from a corner.
The goal came with 10 minutes remaining and sparked celebrations inside an atmospheric Electrical Services Stadium.
It was an incredibly scrappy goal, with Portsmouth spurning several opportunities to clear the corner.
The last of these fell to Alex Wynter, who was off balance on the line and could not manage to kick the ball to safety.
The first tie had finished 2-2, with Molesley also on the scoresheet at Fratton Park.
And after the victory on Wednesday, the midfielder said: "You can see what it means to everyone. The FA Cup gives a lifeline to so many clubs and boy do we need it. It was a gritty performance, a blood and thunder cup tie and that suited us."
The result means that Pompey are still looking for their first victory in the FA Cup since they defeated Tottenham in the semi-final of the 2010 competition.
The Shots can now look forward to testing themselves against a League One side when Rochdale visit on 7 December.
Aldershot Town manager Andy Scott told BBC Surrey:
"It's fantastic - we've played two games against a big club like Portsmouth and been the better side over those two games.
"It's been a fantastic effort from the lads and it's great to have another clean sheet. We are on a good run of form and that is absolutely brilliant.
"They've always believed in themselves and we have had a tough time but they keep working ever so hard in training and they are a great bunch to be around."
- 12GibbsBooked at 85mins
- 2OastlerBooked at 68mins
- 6BarkerSubstituted forDialloat 37'minutes
- 16RobinsonBooked at 57mins
- 3WhatmoughBooked at 75minsSubstituted forChorleyat 76'minutes
- 8J Wallace
- 25AtanganaBooked at 43mins
- 9TaylorSubstituted forAgyemangat 82'minutes
- 20WestcarrSubstituted forStoreyat 82'minutes
- Stuart Attwell
- Shots on Target
Second Half ends, Aldershot Town 1, Portsmouth 0.
Attempt missed. Danny Hollands (Portsmouth) left footed shot from outside the box is too high. Assisted by Nigel Atangana.
Foul by Danny Hollands (Portsmouth).
Nabi Diallo (Aldershot Town) wins a free kick on the right wing.
Corner, Aldershot Town. Conceded by Alex Wynter.
Attempt saved. Miles Storey (Portsmouth) right footed shot from the right side of the box is saved in the bottom right corner. Assisted by Jed Wallace.
Foul by Jed Wallace (Portsmouth).
Jordan Roberts (Aldershot Town) wins a free kick in the defensive half.
Jaydon Gibbs (Aldershot Town) is shown the yellow card for a bad foul.
Ricky Holmes (Portsmouth) wins a free kick on the left wing.
Foul by Jaydon Gibbs (Aldershot Town).
Attempt missed. Ricky Holmes (Portsmouth) right footed shot from outside the box is too high from a direct free kick.
Danny Hollands (Portsmouth) wins a free kick in the attacking half.
Foul by Mark Molesley (Aldershot Town).
Substitution, Portsmouth. Miles Storey replaces Craig Westcarr.
Substitution, Portsmouth. Patrick Agyemang replaces Ryan Taylor.
Goal! Aldershot Town 1, Portsmouth 0. Mark Molesley (Aldershot Town) left footed shot from very close range to the centre of the goal following a corner.
Attempt blocked. Glenn Wilson (Aldershot Town) right footed shot from very close range is blocked.
Attempt blocked. Joe Oastler (Aldershot Town) right footed shot from the centre of the box is blocked.