Jack Muldoon's extra time wonderstrike ensured Town reached the Semi-Finals of the FA Trophy for the first time after a quite incredible afternoon at AFC Fylde.
Town had come back from a goal down after trailing through Jordan Williams' opener, with Lloyd Kerry and Jack Muldoon scoring within a minute, which had looked like enough for victory, until Luke Burke's stoppage time thunderbolt forced extra time.
With 103 minutes minutes on the clock, Muldoon landed the final blow, beating Sam Hornby from 30 yards and in the process ending Town's 11-match run without a win against his former club.
Simon Weaver had made seven changes from last weekend's victory over Eastleigh as Joe Cracknell, George Smith, Jack Emmett, Brendan Kiernan, Alex Bradley, Kian Harratt and Max Kouogun were all given a chance to impress.
There were changes for the hosts too as Jim Bentley brought Danny Philliskirk, Andy Taylor, Mark Yeates and Kurt Willoughby back into the side.
Harratt was first to catch the eye, shooting from just outside the area and forcing a good one handed save from Sam Hornby to tip the goal bound attempt over.
Kouogun was next to go close, the centre back heading George Thomson's free kick delivery wide of the target.
Hornby was by far the busier of the two stoppers in the opening 20 minutes as the Fylde keeper produced an almost identical save to keep out Warren Burrell's header.
Most of the headway continued to be made by Town as Bradley, Emmett and Harratt all had efforts on goal, but none with the accuracy to open the scoring.
Town did end the half having limited their opponents to no shots at goal, but with the wind in their favour will have been disappointed to be going into the break still on level terms.
The Coasters' first attempt arrived in the second minute of the second half as Yeates' cross was headed into Cracknell's arms by Jordan Williams.
Cracknell was called into action again minutes later, stopping Willoughby's effort at close range, but could do nothing to prevent the hosts taking the lead from the resulting corner as Williams volleyed home from inside the six yard box.
Burrell should have levelled three minutes later as Thomson's corner fell to him vie Lloyd Kerry, but Town's Captain for the day couldn't keep the finish down.
The contest was much more even than the first 45 with both sides fashioning chances as Cracknell kept out Willoughby's powerful drive and watched the former York man's follow up miss the target.
Weaver opted to introduce Muldoon and Jon Stead in the 67th minute and the decision paid dividends six minutes later as Muldoon got between two Fylde defenders and pulled out Kerry to place the ball in the bottom left corner.
Within a minute of the equaliser going in, Town had a second and were ahead for the first time as Muldoon found the same corner as Kerry at the second attempt, leading to jubilant scenes with the travelling Town army at his former club.
Just as it looked like Town had ended their Coasters curse, Burke sent a rocket past Cracknell in stoppage time that ensured another 30 minutes at least would be needed to decide a winner.
Jack Diamond was introduced early into the additional period and quickly showed what he was capable of, racing forward from his own half but firing into the side netting.
Not wanting to be outdone by Burke, Muldoon picked his head up 30 yards out and sent a dipping effort past Hornby to restore his side's advantage and inflict more damage to his former side.
As expected, Fylde poured forward in the second half of added time, but this time Town held on to secure their place in the Semi-Final.
Town: Cracknell, G Smith, Burrell, Thomson, Emmett (Muldoon 67), Kiernan (Diamond 93), Bradley, Kerry (Hall 117), W Smith, Harratt (Stead 67), Kouogun
Subs not used: Belshaw, Falkingham
Goals: Kerry 73, Muldoon 74, 102
AFC Fylde: Hornby, Byrne, Whitmore, Croasdale, Philliskirk (Montrose 105), Williams, Burke, Taylor (Jameson 117), Yeates (Kosylo 93), Willoughby, French (Proctor 76)
Subs not used: Lavercombe
Goals: Williams 53, Burke 93
Referee: J Bell