Luke Norris hit an injury-time winner as basement side Northampton upset League Two leaders Fleetwood 1-0 at Sixfields.
Fleetwood, who slip to fourth in the table as a result, went into the game on the back of four successive wins in all competitions while Cobblers had not triumphed at home since August.
But they had a couple of early chances, Mathias Kouo-Doumbe went close with a header and Jacob Blyth fired wide from the edge of the box.
The visitors were denied by the woodwork when David Ball struck the crossbar before Blyth tested Scott Davies at the other end.
Both sides failed to create too many chances as the half progressed, with the respective defences on top, but Norris did head wide just before the break.
The Cod Army made the better start after the interval, with the impressive Ryan Cresswell having an effort blocked, but Norris was again denied by Davies and Kane Ferdinand shot wide for Cobblers.
A scrappy second half followed the pattern of the first as opportunities to break the deadlock came at a premium.
Fleetwood sensed all three points were up for grabs in the closing stages and Jeff Hughes spurned a couple of chances. The midfielder blazed over the bar after goalkeeper Matt Duke failed to deal with a cross and then missed the target from a corner.
Cobblers ended the game with a flurry and Norris wasted a good opportunity after breaking into the box, Davies saving his angled drive.
But he made amends in stoppage time when he beat Davies with a free-kick which found the top corner.
There was still time for Hughes to head over from a corner but Cobblers held on for a vital victory although they remain rooted to the foot of the table.