Richie Barker produced a late wonder goal to give Rotherham their first win over Chesterfield for 25 years.
Ronnie Moore's Championship side had not beaten Chesterfield for a quarter of a century and 22 games, but Barker slammed in his first goal of the season seven minutes from the end.
Chesterfield, who beat league leaders Colchester on Saturday, had a flying start, rattling Rotherham with an early goal.
The opener came in the 15th minute when Shane Nicholson's curling cross from the left found Mark Allott unmarked . He smashed a first time volley that bounced over ex-Chesterfield keeper Mike Pollitt.
Livewire youngster Jamal Campbell-Ryce harassed Robbie Stockdale with a string of searing breaks down the left as the visitors looked to stretch their advantage.
Mark De Bolla might have added a second after he produced a clever flick to beat Shaun Barker but then volleyed wide.
Five minutes later De Bolla should have done better but hesitated before shooting and was robbed by Paolo Vernazza.
Only a super save from Carl Muggleton denied Rotherham an equaliser after 32 minutes when he turned away a blistering effort from Michael Proctor.
But a minute later the home side were level when Darren Garner swung in a sharp free-kick and Proctor was left unmarked to head in his first goal of the season.
After the break Muggleton shone again to twice deny ex-Watford midfielder Vernazza with a pair of stinging volleys before blocking a low shot from John Mullin.
Rotherham keeper Pollitt - barracked by the Chesterfield fans throughout - produced his own heroics when French frontman Tcham N'Toya-Zoa darted into the area and looked certain to score only to see the keeper block.
Then in the 83rd minute Barker went on a rampaging run down the right, galloped inside and unleashed an unstoppable 20 yarder to claim the win.