Defender Aaron Pickles headed home the winning goal to put Accrington Stanley through to the third round of the FA Youth Cup where they have a home tie against Swansea City.
Bolton led 1-0 at half-time through Lamine Toure at the Wham Stadium but whatever John Miles said at half-time did the trick.
Under 18s top scorer Leslie Adekoya scored a second half double before Toure levelled the scores for Bolton.
However Pickles headed home from close range on 78 minutes to the celebrations of the fans and Stanley boss John Coleman.
And Stanley held on despite Harvey Monk seeing red in added time for two yellow cards.
Bolton had the first chance with Noah Halford heading into the side netting.
On 11 minutes, Calvin Harper had a great chance for Stanley when Owen Devonport put him through but Bolton keeper Jack Dallimore pushed his strike over the bar.
Wanderers took the lead on 18 minutes when keeper Louis Hood couldn’t hold onto a long range strike and Toure nipped in and fired home from close range.
Stanley battled to get back in it as it went from end to end, Arran Pettifer blasting over for Bolton and Lewis Trickett firing narrowly over for the Reds.
Harper came close with a long range effort for Stanley, denied superbly by Dallimore, and Adekoya had a shot blocked on the stroke of half-time.
After the re-start, Bolton goalscorer Toure fired wide in a decent position before Stanley equalised on 62 minutes.
Harper raced forward and his strike couldn’t be held by Dallimore and Adekoya poked the ball home from close range.
The game then burst to life with three goals in six minutes.
Adekoya put the Reds ahead on 72 minutes when he grabbed his second of the game with a close range finish. This was his 13th goal in the last six games.
However, it was 2-2 on 75 minutes when the ball came out to Toure in the area and his shot bounced past Hood for his second of the game.
Stanley kept believing though and, on 78 minutes, Pickles headed home from close range after a superb save from Dallimore to push out Devonport’s header.
The Reds ended with ten men with Monk sent off in added time for two yellow cards in quick succession.
ASFC: Hood, Akukwe, O’Brien ©, Gough (Kardacz), Pickles, Monk, Devonport, Harper (Lawton), Adekoya, Trickett, Poilly
Subs: Clayton, Henderson, Newton, Procter, Eze
Bolton: Dallimore, Burgess, Conway, Halford, Kamara, Sharples, Henry, Tweedley ©, Toure, Pettifer, Wilcox
Subs: Maher, Inwood, Frimpong, Beardsworth, Shakespear, Pinto, Fleury