Goals from Mark Allott and Chris Brandon earned Chesterfield a place in the second round of the LDV Vans Trophy as they overcame ten-man Halifax in a tight game.
The Spireites went ahead on ten minutes when Allott lashed home from 12 yards after Town keeper Tom Morgan dropped a cross at his feet.
The Shaymen hit back and almost equalised just after the half hour when Ian Fitzpatrick saw his long-range efforts skim the bar.
But the visitors were then reduced to ten men just before the break when striker Andy Farrell was sent off for a challenge on Kevin Dawson.
However they continued to battle after half time, but Chesterfield midfielder Brandon sealed the win with a wonderful solo effort deep into injury time