Jack Sowerby struck a last-minute winner at Victory Park as Fleetwood beat Vanarama National League North side Chorley 2-1 in the FA Cup.
Marcus Carver gave the non-league outfit the lead just before the hour mark but goals from Devante Cole and Sowerby spared Fleetwood's blushes after Lewie Coyle had been sent off for the visitors.
The game did not spark into life until the Magpies opened the scoring when Josh O'Keefe and Carver combined to punish a poor clearance from Fleetwood defender Ashley Eastham.
The bumper crowd were dreaming of a second-round clash with Hereford when Coyle saw red for a late challenge on Jake Cottrell.
But a string of substitutes helped rescue Uwe Rosler's side as Wesley Burns' fine cross found Cole, who looped his header into the net with 13 minutes remaining.
Sowerby then completed the comeback as he flicked his shot beyond Oliver Byrne in stoppage time.