TOWN crashed out of the Johnstone’s Paint Trophy on penalties after a stunning fightback at soggy Saltergate.
Stoppage-time strikes by Anthony Pilkington, his second of the second-round tie, and Nathan Clarke rescued Town from 3-1 down.
But spot-kick misses by Pilkington, who blazed over, and Jim Goodwin, whose effort was saved, meant Chesterfield won the shoot-out 4-2 without having to take their fifth penalty.
For the record, Robbie Williams and Antony Kay put away their penalties, but that will be of little consolation to boss Lee Clark.
His selection was limited because of a suspension for skipper Peter Clarke, injuries to right-back Lee Peltier and midfielder Danny Drinkwater, and strikers Robbie Simpson and Theo Robinson both being hit by illness.
Andy Butler, Michael Collins, Gary Roberts, Pilkington and Jordan Rhodes all returned to the starting XI as Town tried to snap a run of three successive away defeats and five games without a win.
Clark also named 17-year-old academy winger Aiden Chippendale among the five substitutes permitted in this competition.
Chesterfield, who included newly signed Wolves loan defender Mark Little, were chasing a fourth straight win at their crumbling Saltergate home, which will be abandoned when they move to a new stadium next season.
Town, with Kay handed the captain’s armband and James Berrett playing at right-back, adopted a 4-5-1 system, and with the rain coming down heavily, lone striker Rhodes had the first shot on four minutes.
Fed by Joe Skarz, he played a neat one-two with Pilkington, with his shot deflected for a corner.
The game was being played at a good tempo, and Chesterfield’s first real attack came as they counter-attacked from another Town corner in the 19th minute.
Jamie Lowry latched onto a long ball out of defence, but Town keeper Alex Smithies read the situation well and came out of his area to kick clear.
Pilkington’s awkward cross-cum-shot on 21 minutes was well held by home keeper Tommy Lee before Town had a let off in the 29th minute.
On-loan Manchester City midfielder Donal McDermott picked out Jack Lester, and while he was blocked out by Butler, the ball spun free to right-back Drew Talbot, who curled a 20-yard shot just over.
Pilkington, playing mostly wide left, was busy, and his shot on the turn from Roberts’ 32nd-minute pass brought another save from Lee.
Soon after, Rhodes shot wide from distance following Kay’s neat back-heel.
Nathan Clarke was harshly penalised for his 37th-minute tackle on Lester, handing Chesterfield a free-kick in a dangerous position 25 yards out, but McDermott hammered the ball straight into a six-man wall.
Then, when Town won a free-kick 30 yards out, Kay floated the ball in for Rhodes to test Lee with a glancing header, the ball being clawed against the face of the post as the keeper dived to his left.
Town created one more chance before the break, with Butler heading just over from a Roberts corner.
Collins came close twice in the space of three minutes as Clark’s men pushed forward at the start of the second half.
First he fired a 53rd-minute shot against Lee’s right-hand upright after the keeper blocked a Rhodes shot, then, after being set up by Roberts, he turned neatly to shoot across the face of goal from the left side of the area.
It was a big setback for Town when Chesterfield went ahead against the run of play in the 57th minute, Talbot heading home from McDermott’s teasing cross.Related content
But the visitors remained composed to force a deserved 64th-minute leveller through Pilkington, who volleyed home after Lee blocked Rhodes’ header from a beautifully-weighted Kay cross.
Ten minutes later, however, Chesterfield were back in front, again through Talbot.
This time, the former Luton man found the roof of the net with a left-foot volley after Little surged down the right and crossed.
Back came Town, with Butler heading narrowly over from Pilkington’s well-delivered free-kick and Kay rasping in a 78th-minute long-range shot which looked destined for the net until Lee clawed it away.
Both Lionel Ainsworth and Lee Novak were brought on as Town sought fresh inspiration, and the latter skimmed the top of the bar with an 85th-minute header.
Town’s hopes appeared to have been ended by a cruel third goal from the home side, substitute Jordan Bowery driving home in the 89th minute.
But Pilkington pulled one back direct from a free-kick two minutes into stoppage time, and the home side were stunned when Nathan Clarke lashed the ball into the roof of the net from a Pilkington corner to force the penalty shoot-out.