A Tommy Leigh double helped Accrington Stanley reach the knock-out stages of the Papa Johns Trophy as they overcame Liverpool Under 21s 3-2.
The Reds needed to win the game to finish in the top two of Group D and Ryan Astley added a third but John Coleman's men had to survive a late fightback to be in the hat for the last 32.
Lukas Jensen came back into goal while striker Touray Sisay made his first start since signing for Stanley in the summer.
Liverpool had the ball in the net on five minutes through Melkamu Frauendorf but it was ruled out for off-side.
Stanley opened the scoring on 12 minutes when Shaun Whalley tricked his way into the area and his cross found the inrushing Leigh who fired home.
Sisay raced clean through as Stanley looked for a second but keeper Harvey Davies thwarted him and, on 23 minutes, Sisay’s close range effort was cleared off the line.
Jensen denied Layton Stewart as he looked to capitalise on the edge of the box and Dominic Corness curled a strike narrowly wide from distance for Liverpool Under 21s.
Leigh fired home a second just after the re-start when former Liverpool midfielder Liam Coyle won the ball in the Liverpool half, fed Leigh who slotted the ball past Davies.
Substitute Nathan Delfouneso couldn’t find the target from a Whalley cut back before one of the assistant referees limped off injured on 67 minutes – he became the fourth official for the rest of the game.
Delfouneso ran through again but Davies kept out his effort and, from the resulting 70th minute Sean McConville corner, Astley headed home the third.
Accrington-born teenager Lewis Trickett, who came through the ranks with the Reds, came on for his Stanley debut on 78 minutes and the midfielder had the ball in the net with one of his first touches but it was ruled out for off-side.
Sub Calvin Ramsay, a £6.5m summer signing from Aberdeen, lashed home for Liverpool Under 21 in the first minute of added time and, in the fourth minute of added time, after a goalmouth scramble 16-year-old Ben Doak made it 3-2 and set up a nervy finale.
Stanley: Jensen, Sloane (Clark), Astley, Fernandes, Rodgers, Whalley, Conneely (Martin), Coyle, McConville (Nolan), Leigh (Perritt), Sisay (Delfouneso)