Kayden Jackson's second half volley saw Derby come from behind to beat neighbours Chesterfield and reach the second round of the Carabao Cup.
An Armando Dobra goal, scored inside the first 30 minutes, gave the Football League newcomers a shock lead, having been set through on the right after a sluggish Rams' start.
Liam Thompson equalised 10 minutes later with a wonderful strike from the edge of the penalty area, to put the Championship side level at the break.
Jackson's first Rams' goal, scored after a goalmouth scramble following several set pieces, proved decisive in this Derbyshire derby.
The key moment in an entertaining cup tie came on the hour mark, when Paul Warne made a quadruple substitution, with Jackson one of four players to come on.
From then, Derby had more control of the game and were the only side to really threaten, despite the Spireites’ best efforts.
It was an improved performance from Warne's side, after a humbling 4-2 defeat to Blackburn Rovers on their return to the Championship on Friday.
Chesterfield caused their second tier opponents plenty of problems, roared on by a loud and boisterous away support, which will give manager Paul Cook plenty of hope after returning to League Two this season.