In a National League playoff final at Wembley that was dominated by goalkeeping errors, substitute stopper Archie Mair saved two penalties as Notts County prevailed 4-3 in a shootout after a thrilling 2-2 draw.
An Andrew Dallas penalty gave Chesterfield an early lead, but a late John Bostock free kick found its way into the net to force extra time.
A terrific individual effort from Armando Dobra put Chesterfield back in front, only for a fortuitous Ruben Rodrigues shot getting Notts County back on level terms for the second time in the contest.
Darren Oldaker and Jeff King ultimately missed the decisive spot kicks for Chesterfield, but Mair deserves the plaudits for two outstanding stops having played just the final two minutes of extra time.
After their near miss with automatic promotion, the bulk of the pressure was on Notts County, and goalkeeper Sam Slocombe did little to ease the tension in the opening stages.
Slocombe gave away an indirect free kick in the penalty area, redeeming himself with a save on that occasion, before conceding a penalty for a foul on Dallas moments later.
Dallas got back to his feet to calmly slot the ball down the centre, watching Slocombe dive to the right, to give Chesterfield the early advantage.
Sam Austin had Notts County's best chance of an equaliser in the opening quarter, diverting a cross over the crossbar from close range, but Chesterfield looked the greater threat each time that they surged forward.
Chesterfield were having countless joy down the flanks without taking advantage, but they were still able to reach half time with minimal scares at the other of the pitch.
After the break, it was all Notts County without the regular season runners-up creating enough clear-cut chances in the penalty area, top goalscorer Macaulay Langstaff largely an isolated figure.
However, Notts County should have been level on 67 minutes. A free kick found the head of Connell Rawlinson, who seemingly only had to hit the target to equalise, but he attempted to be too precise and his effort missed the far post by inches.
As the match entered the final five minutes, Slocombe almost gifted Chesterfield another goal, only for Liam Mandeville to fire over from the edge of the area.
That proved costly as Notts County, against the run, quickly equalised. With a free kick out wide, Bostock attempted to catch out goalkeeper Ross Fitzsimons at his near post, succeeding as the ball squirmed under his body and crept inside the near post.
While the momentum was arguably with Notts County heading into extra time, that soon changed as Dobra put Chesterfield back in front in the third minute of the additional 30.
Having been found in space on the left, Dobra was given the time to cut onto his right foot to find the far corner of Slocombe's net with a terrific effort from 16 yards.
Langstaff became a threat as extra time progressed, first pulling a low effort wide of the far post after beating the offside trap before Fitzsimons claimed comfortably at the bear post from a similar position on the opposite side of the area.
Notts County laid siege to the Chesterfield goal in the second period and got their reward when Rodrigues hit a shot into the ground and it subsequently bouncing over the head of Fitzsimons and into the net.
Chesterfield held on for the remaining minutes of extra time as Notts County boss Williams opted to bring on second-choice stopper Mair for the penalty shootout which was about to follow.
The decision proved to be inspired as Mair gave his team a chance to win with their fourth kick, only for Bostock to inexplicably chip the ball onto the crossbar.
That moment of madness heaped the pressure on Cedwyn Scott - who recently missed a last-gasp penalty in the defeat to champions Wrexham - but he made no mistake on this occasion as Notts County secured their return to the EFL after four years away.