Preston North End finished the season on a winning note against Burton Albion at Deepdale but it was not enough to get them into the play-offs.
A win for Derby County against Barnsley meant the Rams kept hold of sixth spot, North End having to settle for a seventh-place finish.
The victory over Burton had big consequences at the other end of the table though, it relegating the Brewers - Nigel Clough's men needed to win after Bolton came from behind to beat Nottingham Forest.
North End came out on top despite playing most of the second half with 10 men after Billy Bodin was sent-off, Bodin getting his marching orders for two bookings.
The first was for deliberate handball after he used his arm to knock the ball over the line in the first half, his second for simulation in the box when looking for a penalty.
Callum Robinson put PNE into a 26th minute lead, heading home after Paul Huntington had nodded a corner across goal.
Hope Akpan fired the visitors level with a fine finish from outside the box in the 63rd minute, at the time that goal looking enough to secure their Championship status.
But in the closing stages, the scoreline at Bolton meant that Burton had to push for a winner.
They piled forward in search of a goal, however it was North End who took advantage on the counter-attack to score a 93rd minute winner.
It was scored by substitute Louis Moult who side-footed home from close-range after being teed-up by Ben Pearson.
The North End starting XI had shown two changes from the side which had played at Sheffield United last week, Tom Clarke and Bodin coming in for Ben Davies and Daniel Johnson.
Before kick-off, both teams formed a guard of honour for John Welsh who is leaving Preston in the summer after six years.
He was presented with a shield by PNE boss Alex Neil as a mark of thanks for his long service and leadership.
It was a fairly sedate start to the game in the sunshine, Burton sitting deep and looking to counter while North End saw more of the ball.
Albion keeper Stephen Bywater punched clear a Robinson cross under press from Sean Maguire as PNE started to make some headway into the visitors' box..
Declan Rudd came to North End's record in the 23rd minute as Paul Huntington's slip in the box presented Marvin Sordell with a sight of goal.
Sordell got a shot away from 10 yards on the angle, Rudd saving well with his legs, the ball going out for a corner.
Robinson should have scored when he got in behind the Burton defence and clear on goal but Bywater came off his line to save the PNE man's shot with his chest.
However, there was no denying Robinson moments later as he gave the Lilywhites a 26th minute lead.
Josh Harrop delivered a corner from the left deep to the far post where Huntington rose to meet it.
The centre-half nodded it back across goal for Robinson to head home from six yards.
North End should have doubled their advantage in the 33rd minute when Bodin's pass released Robinson down the right channel.
The goalscorer pulled the ball back across the box into the path of Maguire who slightly off balance scooped a shot up against the bar when really he should have buried it.
Bodin had the ball in the net in the 35th minute but the assistant on the Invincibles Pavilion side judged that the winger had used his hand to knock Robinson's cross over the line.
Referee Andy Madley disallowed it and booked Bodin for deliberate handball.
In the second minute of first-half stoppage-time, Tom Flanagan cut inside from the Burton left and drove a shot high over the bar.
PNE lost Bodin five minutes into the second half when he went to ground as he tried to go past Flanagan and Tom Naylor.
It was an exaggerated fall and the referee gave a free-kick Burton's way before showing Bodin a second yellow and then red.
Just after that, Maguire did well to take the ball to the byline to the right of goal but his cross was cut out by the keeper.
Rudd pulled off a routine diving save in the 54th minute to hold Luke Murphy's low shot from the edge of the box.
Tom Barkhuizen replaced Maguire just before the hour mark, the substitution going up front with support from Robinson on the left.
Liam Boyce headed a cross from Flanagan just wide before Burton's pressure told in the 63rd minute when they pulled level.
North End had two or three attempts to deal with a corner but couldn't clear their lines, the ball falling to Akpan who curled a fine shot from 20 yards past Rudd.
It needed a fine save from Rudd three minutes to keep the scoreline level, the keeper flinging himself to his right to tip Sordell's header past the post.
Paul Gallagher joined the action in the 68th minute and within five minutes went close to scoring, his low shot from 20 yards pushed behind low down by Bywater.
In the closing stages, Burton pushed forward and left gaps at the back, that allowing Preston to counter-attack at will.
Robinson twice getting through on goal but put the first one wide and then saw the keeper block the second.
But Preston did find a winner in the 93rd minute, Pearson leading the charge down the left channel on the counter.
He got into the box and with just the keeper to beat, unselfishly squared a pass into the path of Moult who side-footed home.
PNE: Rudd, Fisher, Clarke, Huntington, Cunningham, Pearson, Browne (Moult 81), Bodin, Harrop (Gallagher 68), Robinson, Maguire (Barkhuizen 59). Subs (not used): Johnson, Spurr, Earl, Maxwell.
Burton: Bywater, Brayford, McFadzean, Naylor, Flanagan (Dyer 74), Davenport (Bent 61), Sordell, Murphy, Akpan, Akins, Boyce. Subs (not used): Allen, Samuelsen, Buston, Sbarra, Campbell.
Referee: Andy Madley (West Yorkshire)
Attendance: 17,085 (19,69 away)