Wayne Allison made a scoring return to Bristol City to deny them a foothold in the play-off zone.
Now 36 the striker, who had five years at City, menaced defenders and outjumped them as Chesterfield surged into a two-goal lead inside 14 minutes.
That was doubly incredible for they had not won in 20 previous visits dating back to 1901.
Their first strike came with just 45 seconds on the clock. Caleb Folan cut in from the right wing and his low cross left Mark Hudson a clear chance at the far post.
City had planned to go on the attack by playing with two wide men in Scott Murray and Marc Goodfellow, but until the second half looked very lightweight.
Allison's goal came at the end of a sequence of three free-kicks when Shane Nicholson swept the ball in for the veteran to head it past Steve Phillips with the help of a slight deflection off Danny Coles.
There could have been another one for him midway through the half but Phillips denied him with a punched clearance.
Without a win in seven games, Spireites manager Roy McFarland had gambled on the line-up which finished 4-2 losers at home to Wrexham in their last game.
He got the reply he was looking for as City struggled to find momentum.
They had to wait until early in the second half before their first dangerous shot and although Stephen Brooker was off target with it, it signalled a step up in pace and desire as City won four quick corners.
Clayton Fortune was also sent on in place of Tony Butler to give them extra inches in the backline to counter the aerial power of Wayne Allison and Folan.
City came back into the game with two goals in four minutes. A long ball from Brian Tinnion saw Brooker a fraction onside as he closed in with a sharp drive for his season's 14th goal.
The Robins were now on top and hauled themselves level when right-back Jamie Smith thumped a pass from Goodfellow high into the net.
Chesterfield though grabbed the winner three minutes from time with Hudson claiming his second goal of the night, his mishit effort from the edge of the box being badly misjudged by Phillips.