Three goals in the final 10 minutes denied the Cobblers a major upset as Swansea City left it late to come from behind and win 3-1 in the first round of the Carabao Cup on Tuesday night.
Town were on the brink of a huge scalp with 10 minutes to play at the Liberty after Matty Warburton's first goal for the club had handed them a shock lead on the hour-mark.
But after 80 minutes of stern defending and clinical attacking, the visitors then fell apart in the final 10 and succumbed to their Championship hosts as Swansea's record signing Andrew Ayew came off the bench to score twice.
A cagey and low-key first-half was short on goalmouth action and that was largely down to the organised and well-drilled visitors who restricted Swansea to speculative long-range attempts.
City lacked the craft and guile to cut open Town and they were facing an early exit in the competition when Warburton calmly rolled home on 61 minutes, but it wasn't to be as the home side rallied late on.
Currently on a run of eight games in 24 days, Keith Curle used the trip to Wales to shuffle his pack and make seven changes in all, handing starts to Joe Bunney, Jay Williams and the lesser-spotted Billy Waters.
Shaun McWilliams also started and Ryan Watson captained the side in the absence of Charlie Goode and Nicky Adams, both of whom didn't make the trip and were left at home to rest.
Town didn't look out of place in the opening exchanges at the Liberty as they eased themselves into the contest and enjoyed some good, if harmless, early possession.
The onus was on Swansea to the find an extra gear and up the ante but a much-changed team lacked the quality and guile to break down their visitors, largely limited to pot shots.
Attacks were equally toothless up the other end although Watson volleyed off target from the edge of the box before Matty Warburton did likewise. The latter also toe-poked a shot into the gloves of Kristoffer Nordfeldt.
The long-range shots kept coming for the home side, meanwhile, with David Cornell alert to Kristoffer Peterson's low drive and George Byers' attempt deflecting fractionally over.
Swansea continued to probe and press, cranking up the pressure as half-time approached, but Cobblers, organised and switched on at the back, stood up the task to go into the break goalless.
It was more of the same in the moments after half-time when Warburton drilled his third effort over the crossbar and McKay shot weakly at Cornell.
The deadlock was broken just past the hour-mark and it was done so with a well-worked goal, but not scored by the higher-ranked side. Instead, Town moved into a shock lead when Williams controlled a long ball and fed Waters who in turn slipped through Warburton and he found the bottom corner with a delicate, precise finish.
That belatedly jolted Swansea into life and they were quick to threaten a response but Cornell twice came to the rescue for the Cobblers, keeping his nerve to deny Jordon Garrick one-on-one and then diving to his right to beat away Sam Surridge's header.
Town had defended brilliantly for 80 minutes but it was a series of errors that was their undoing. Morgan Roberts, just on as a sub, sliced his clearance back into the danger area and Cornell tried and failed to punch, allowing Ayew to nod into an unguarded net.
Suddenly the atmosphere had transformed and now it was all Swansea, and it took just three minutes to complete the turnaround when Byers picked out the bottom corner from 20 yards.
It got worse for the Cobblers when Ayew nodded in a third from two yards out with one minute to play, making for a harsh final scoreline on Town who had been so good for 80 minutes.
Swansea: Nordfeldt, John, Wilmot, Peterson (Ayew 62), Surridge, Dhanda (De Boer 89), Naughton (c), McKay (Garrick 72), Routledge, Byers, Cabango
Subs not used: Mulder, Rushesha, Cullen, Cooper, Garrick
Cobblers: Cornell, J Williams, Wharton, Turnbull, Bunney, McWilliams, Watson (c), Warburton (Roberts 77), Waters (Lines 64), Hoskins, A Williams (Smith 64)
Subs not used: Lashley, Pollock, Morias, Oliver
Referee: Kevin Johnson