Notts County had missed out on automatic promotion by just four points to title winners Wrexham
Substitute goalkeeper Archie Mair, brought on to replace Sam Slocombe in the 120th minute, crucially saved spot-kicks from Darren Oldaker and Jeff King before Cedwyn Scott sealed a dramatic 4-3 shootout triumph.
Victory for the 161-year-old Magpies, who were founder members of the Football League in 1888, ended their four-year non-league exile while defeat consigned Chesterfield to a sixth season in the National League.
Ruben Rodrigues had bounced a volley off the turf and over goalkeeper Ross Fitzsimons to level at 2-2 in the second half of extra time to ensure the showdown would be decided from the spot.
Armando Dobra's curled finish had restored Chesterfield's lead in the first period of 15 additional minutes after an enthralling game ended 1-1 at the end of normal time.
A calamitous start from Notts goalkeeper Slocombe - which had the Magpies defending a rare indirect free-kick inside the box after just two minutes - cost them dearly as his challenge on Andrew Dallas allowed the striker to put Chesterfield ahead from the spot.
The Spireites had Notts scrambling to stay in touch at the break as the side that won a club-record 32 league games during the regular season struggled to muster a meaningful response.
Sam Austin sent a shot over the bar from the edge of the area and Connell Rawlinson wastefully steered a header wide for a much-improved Notts after the break.
Liam Mandeville squandered a late chance to seal victory moments before Notts veteran John Bostock caught Fitzsimons out with a set-piece that skipped in at the near post.
Dobra edged the Derbyshire club back ahead three minutes after the restart, and after Macaulay Langstaff and Rawlinson went close to again restoring parity, it was Rodrigues who ensured the final would be decided from 12 yards.
After four years and three failed play-off attempts - including defeat by Harrogate in a 2020 promotion final played behind closed doors at Wembley during the Covid-19 pandemic - Notts finally secured their English Football League (EFL) return at the end of a record-breaking season.
Luke Williams' side were pipped for automatic promotion and the title by Hollywood-funded Wrexham, who topped the table with an all-time high 111 points.
The 107 points the Magpies collected to finish second would have got them straight up as champions in every other season before this one.
The club-record wins total and 117 goals in a campaign - which included a record 25-game unbeaten league run between September and February - would have counted for nothing if they had lost at the national stadium.
Chesterfield finished one spot below Notts in the table, but the gap between the two was 23 points.
They were the only side, other than Wrexham and Notts, to have a spell at the top of the table early in the season - and they pushed Notts to their limits at Wembley in an incredible energy-sapping game.
Penalty shootout hero Archie Mair joined Notts on loan from Norwich City
Chesterfield were presented with a bizarre chance almost immediately after kick-off when they conceded an indirect free-kick in the penalty area.
Notts set their entire side up a yard in front of the goalline to block Jeff King's effort from the left of the penalty spot, but the uncertain start by the Magpies quickly got worse.
Slocombe raced out to try shut Dallas down on the edge of the area, but caught the Spireites forward as he tried to lift the ball beyond the keeper.
Dallas collected himself and went straight down the middle to beat Slocombe from the spot to put Chesterfield ahead after five chaotic minutes.
Nervy Notts struggled to match frenetic Chesterfield for much of the first half, but Austin had a chance to level from close range in the 17th minute when he stretched to meet a lofted cross from Aaron Nemane.
Dallas continued to torment Notts' backline down the left, calling Slocombe into action as the forward attempted pull a dangerous ball back across goal.
It was not until the 37th minute that Notts managed to register a shot on goal with Nemane sending an effort directly into Fitzsimons' hands.
Austin and Rawlinson were off target in search of a second-half equaliser, only for Bostock to deliver with a clever free-kick after a Slocombe error at the other end almost gifted Chesterfield the win in normal time.
Dobra had Chesterfield ahead again in extra time and while Langstaff went close to adding to his National League record 42 goals and Rawlinson also flashed a chance wide, it was Rodrigues who salvaged Notts' hopes.
On-loan keeper Mair, in just his fifth game for Notts, played an instrumental role off the bench with his penalty saves and, after Bostock made a mess of his spot-kick to seal it, Scott kept his cool to secure victory.