Fleetwood Town will play York City in the League Two play-offs.
Town lost their final game of the campaign at Chesterfield but finished fourth in the table - a position they were guaranteed before kick off.
It was Chesterfield who dominated the opening half but Fleetwood who created the better chances.
And from their first real opening, Town grabbed a shock lead.
Matty Blair was the creator and executor, twisting and firing a low shot past Tommy Lee.
Gareth Evans should have doubled the advantage when he broke clear, a touch from the Spireites keeper denying the winger.
Jon Parkin nearly grabbed a second just after the break to settle nerves.
But as it was Chesterfield found a way back.
Town couldn’t soak up the pressure effectively, Jay O’Shea with a curling cross to the back post, Jimmy Ryan applying the head to beat Chris Maxwell.
There was a renewed urgency about the home side who grabbed the lead just five minutes later, Town again taking too long to clear their lines, Gary Roberts lining one up from 20 yards, a glorious curling shot to get the party started.
Town might have levelled when Parkin slipped a neat pass through for Matty Blair, the wide man just beaten to the ball as he closed in on the Spireites goal.
In the end it was settled by a goal worthy of champions.
York’s draw at Scunthorpe combined with Burton’s defeat at Southend resolved the play-off picture.
Town will travel to Bootham Crescent next Saturday.