Already relegated Chesterfield put in a spirited performance before going down to Wycombe Wanderers, who celebrated promotion on the Proact pitch.
The Spireites, under the caretaker charge of Ian Evatt, took the lead in the first half and were well in the game, even after conceding just before the break.
But a goal 14 minutes from time gave Wycombe the points and sparked a full-time pitch invasion from the away end.
Evatt’s Spireites looked to play out from the back quickly and tried to get the ball to wide areas, winning a couple of early corners but failing to trouble keeper Scott Brown.
The visitors had sight of goal in the opening stages, Matthew Bloomfield driving a shot well wide after a loose Louis Reed touch, Nathan Tyson ballooning one over the top.
Having just halted a Wycombe attack, the Spireites put together their best move on 20 minutes, Brad Barry sweeping the ball left to Jerome Binnom-Williams who squared it for Louis Dodds, Brown keeping out the stinging first-time effort with a fine save.
Aaron Ramsdale made his first major contribution shortly after, flying to his left to tip Joe Jacobson’s free-kick around the post.
Chesterfield’s propensity to attack down the flanks almost brought joy in the latter stages of the half, Barry’s first time cross from the right met by Binnom-Williams who headed over.
The opening goal came from another move down that side of the pitch a minute later, Dennis linking up with Barry who strode forward, slammed a shot off the far post and turned to celebrate as Michael Harriman put through his own net.
That lead lasted just six minutes, Luke O’Nien doing brilliantly to get to the byline and whipping a ball across goal for Nathan Tyson to turn in the equaliser.
Evatt’s men were incensed by an apparently erroneous throw in award to the away side seconds before the goal, several of them remonstrating with referee Anthony Blackhouse after the half-time whistle.
Wycombe started the second half well, a ball down the middle forcing Laurence Maguire into a challenge that almost resulted in an own goal.
From the resulting corner, Sido Jombati’s header brought another excellent stop from Ramsdale and the next set-piece caused an almighty scramble in the box before Town eventually won a goal kick.
The home side settled down and created a good chance of their own, Binnom-Williams getting on the end of a corner he had won, heading downwards but agonisingly wide at the back post.
Binnom-Williams was involved again seconds later, stabbing a cross into the penalty area where Dennis met it but couldn’t direct his header on target.
There was a let off for Town when a ball over the top allowed Craig Mackail-Smith to beat the offside trap and hare in one on one with Ramsdale, whose challenge was enough to see the ball trickle wide.
Substitute Paris Cowan-Hall bent an effort just past the post and Tyson curled another over the bar as the Chairboys took control with a quarter of an hour remaining.
It was little surprise when their pressure told, a corner bobbling around the area before it fell kindly to Dominic Gape, his blast from 16 yards going through a crowd and finding the net.
The hosts responded well to the goal however, a Drew Talbot ball forward finding Laurence Maguire in the area, the centre-half chesting it down and volleying onto the crossbar.
A lovely clipped cross from Jak McCourt was headed at goal by Dodds and the ball drifted past the upright.
A Louis Reed shot sailed just over the top in what was the final significant action, before the full-time whistle allowed Gareth Ainsworth, his team and supporters the chance to celebrate automatic promotion.
Chesterfield: Ramsdale, Barry, Smith, Maguire, Nelson, Talbot, Binnom-Williams (Ugwu 71), Reed, Rowley (McCourt 77), Dodds (Brown 87), Dennis. Subs: Anyon, Sinnott, Whitmore, Weir.
Wycombe: Brown, Harriman, Jacobson, El-Abd, Jombati, Gape, Bloomfield (Saunders 87), O’Nien, Tyson, Williams (Cowan-Hall 67), Mackail-Smith. Subs: Ma-Kalambay, Akinfenwa, McGinley, Kashket, Bean.
Referee: Mr Anthony Blackhouse. Assistants: Matthew Parry, Paul Graham.
Goalscorers: own goal 39; Tyson 45, Gape 76
Yellows: O’Nien 60
Attendance: 5,679 (1,131 away)