Finley Munroe headed the visitors in front on eight minutes from Ollie Palmer’s cross but John Fleck equalised with his first goal for the club two minutes later.
The Blues were the better team for the rest of the first-half but they fell behind just after the hour when Joe Snowdon drilled in following a Will Wright corner.
Chesterfield huffed and puffed in the second 45 but they could not find a leveller despite Munroe being sent off with five minutes of added-time remaining after collecting his second yellow card.
The defeat is the Spireites’ first loss in 10 in all competitions and it the result means they drop out of the play-off places.
Here are our player ratings from the game...

9. Liam Mandeville 7
It was his corner delivery that helped create the equaliser. His energy, pressing and flexibility in his positioning caused Swindon lots of problems in the first 45. Kept plugging away in the second 45. Photo: Brian Eyre

10. Dylan Duffy 6
Handed a start. Made the big pitch by keeping his width on the left. A useful weapon in the air. Tired as the game went on and he was withdrawn. Photo: Tina Jenner

11. Lee Bonis 6
Almost continued his good goalscoring form when he stabbed against the post from close-range just before the half-hour mark and he stung the palms of Ripley right on the half-time whistle. Couldn;t sniff out a chance in the second-half. Photo: Tina Jenner

12. James Berry 6
Some might have been surprised not to see him start. Replaced Duffy on 68. Had one deflected over late on. Photo: Brian Eyre

