Pompey Academy fought from behind to secure an extra-time victory over Gillingham and advance to the second round of the FA Youth Cup.
Leroy Hlabi’s early penalty ensured the young Blues faced an uphill struggle on a chilly night at Priestfield.
But Matt Mayes levelled before the break and later slammed home a winner to ensure there would be no need for a shoot-out.
Their reward for seeing off the Gills is a game at Fratton Park, where they will host Lewes in a tie that must be played by November 18.
Pompey got off to a horror start on Halloween, as they conceded a penalty in just the second minute.
Matt Casey was penalised for a foul on Hlabi, with the striker picking himself up to send Jack Collins the wrong way from the spot.
It might have got worse for the visitors when Collins spilled Jack Conway’s fierce drive, but Casey partially cleared and Jason Gildea fired the loose ball over.
The hosts were looking the more threatening side, although a couple of dangerous Freddie Read deliveries had to be dealt with at the other end.
But Collins had to come to the rescue midway through the first half, tipping over Thomas Bramble’s firm header.
Pompey appeared to be hanging on, but found themselves level in slightly fortunate fashion on 26 minutes.
Dan Smith whipped a cross into the box and keeper Louie Catherall palmed it clear, only for the ball to hit MAYES in the face and ricochet into the net.
They came close to grabbing another bizarre goal before the break when Read miscued a pass for Mayes.
The bounce deceived Catherall and looped over him, but team-mate Jack Tucker was back to stop the ball crossing the line.
Casey then breathed a sigh of relief when he brought down Henry Woods and, having already received a yellow card, escaped with just a talking to from referee Damith Bandara.
Half Time: Gillingham 1 Pompey 1
James Whiting was hobbling along the sidelines when the teams emerged for the second half, so it was no surprise to see him replaced by Bradley Lethbridge.
While the first half had begun at a frenetic pace, it was a cagier opening after the break, with neither side able to create any meaningful openings.
Woods tried his luck with a fierce drive from outside of the box, but the ball flew well wide of Collins’ post.
Gillingham did almost restore their advantage just before the hour mark, however, when Gildea’s centre deflected off Joe Hancott and landed on the roof of the net.
The resulting corner then found Ryan Huckle in the box, but his inventive flick was comfortably kept out by Collins.
Pompey started to look more of a threat as the second half went on, but were not able to test Catherall between the sticks.
The keeper had to tear from his line on 71 minutes, though, to stop Mayes from meeting a teasing Smith delivery.
It then looked like Gillingham had won a second spot-kick when Miguel Scarlett went down in the Blues box, only for Bandara to book the right-back for diving.
Pompey had a great chance to forge ahead soon after, but Mayes could not guide the ball on target after meeting Jack Chandler’s cross at the far post.
It was the visitors looking more likely to score and it took some last-gasp defending to deny Lethbridge when he bundled his way into space.
Oscar Johnston replaced Chandler with the minutes ticking down and his first act was to drill a shot inches past the post.
But despite dominating the closing stages, Pompey could not force another goal and the tie went into extra-time.
90 Minutes: Gillingham 1 Pompey 1
After a brief interval to receive instructions, both sides came close to scoring within seconds of the restart.
The hosts were first up and Collins had to beat away a fierce strike from Woods before the ball was hacked clear.
Pompey broke straight up the other end and when Lethbridge fed Mayes, his effort was deflected against the crossbar.
Neither side could be accused of sitting back as the action switched from one end to the next at a breathless pace.
And it was a lovely move that saw the Blues finally take the lead for the first time in the tie on 103 minutes.
Johnston beat his man on the right and slid a perfect pass through for MAYES to calmly angle into the net.
Pompey were struggling at the end, with Jordan Brooks and Lethbridge both collecting knocks and several others suffering from cramp.
But it was Gillingham who finished a man light as Woods said something that Bandara did not like and was shown a red card.
And the visitors managed to see out the final few minutes to secure a hard-fought victory and reach the second round.
Gillingham (4-2-3-1): Catherall; Scarlett, Huckle, Tucker (c), Arnold; White, Bramble (Arthurs 84); Gildea, Woods, Conway (Laing 117); Hlabi
Goals: Hlabi 3 (pen)
Sent off: Woods
Subs not used: Walsh, Sheminant, Noyelle
Pompey (3-5-2): Collins; Brooks, Casey, Dandy; Chandler (Johnston 83), Smith, Read, Whiting (Lethbridge 46), Hancott (Flint 106); Mayes (c), Maloney
Goals: Mayes 26, 103
Booked: Casey, Brooks, Maloney
Subs not used: Pitman, Mnoga
Referee: Damith Bandara