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...

1. Zach Hemming 6
Didn't look like he could do much about Munroe's close-range header for the opener. He might feel he could have got more on his punched clearance from Wright's corner which Snowdon drilled in. Made a smart low save from Drinan and a couple more others late on to stop Swindon adding a third. Photo: Leila Coker

2. Devan Tanton 6
Beaten in the air by Munroe at the back post for the opener. Booked for a challenge on the same player before half-time. Better defending when he denied Palmer early after the break. Photo: Brian Eyre

3. Kyle McFadzean 6
Switched sides with Dunkley from what we have seen all season. In a nice run of form at the moment and he continued that here with some strong bits of defending. Took a knock early after the break and looked like he might have to come off but he shrugged it off. Photo: Submitted

4. Chey Dunkley 6
Got dragged out wide for the opener but showed good awareness to head Mandeville's corner into a dangerous area for Fleck to finish for the equaliser. Had the sort of physical battle against experienced frontman Palmer that he thrives off. Did he need to head behind for a corner which Swindon scored their second from? Did anyone give him a shout? Only they will know. Photo: Brian Eyre

