Huddersfield and Barnsley produced a thrilling draw as both sides escaped relegation on an afternoon of high drama at the John Smith's Stadium.
Scores here and elsewhere had both teams going down at different points, but
Peterborough's 3-2 loss at Crystal Palace
meant they drop into League One.
Chris O'Grady's low shot had put Barnsley in front, only for Jermaine Beckford to equalise for the hosts.
Jason Scotland restored Barnsley's lead but James Vaughan had the final word.
Vaughan's 82nd-minute equaliser would have condemned Barnsley to League One until news filtered through that Palace had scored a third against relegation rivals Posh, at which point it appeared as though both sets of players were happy to maintain the status quo.
Narrow margins in Championship
Despite being in a position that would have sent them down during the course of the afternoon, Huddersfield finished in 19th place - 10 points off a Championship play-off place and four points clear of the bottom three
The visitors had dominated early possession and looked the more assured side, so it was no surprise when O'Grady gave them the lead in the 14th minute.
Town defender Peter Clarke slipped when Barnsley midfielder David Perkins played the ball into the penalty area and O'Grady had time to pick his spot and curl a low right-footed shot inside the far post.
Huddersfield began to get a foothold in the game, but they had to wait until the 53rd minute to equalise, substitute Danny Ward slipping the ball through for Beckford, who clipped a fine finish inside Luke Steele's left-hand post.
Scotland then headed Barnsley back in front in the 75th minute. O'Grady's deft pass sent Perkins clear down the left and his precision cross was nodded home by the former Ipswich striker to send the visiting fans into raptures. The joy did not last.
Town substitute Lee Novak had been on the pitch for only a few seconds when his pass set up Vaughan, whose low finish flew in via a deflection off Steele. Tykes midfielder Tomasz Cywka was then sent on for Dawson with five minutes left as Barnsley scrambled for one last finale.
Scotland failed to connect when poised to turn the ball home and Cywka fired straight at Smithies, but with news of Palace's late goal sending Peterborough down, both sets of players played out the last few minutes without further incident.
Barnsley manager David Flitcroft:
"Mission Impossible achieved.
"We've beaten some incredible football teams and Mission Impossible can only be achieved by special people.
"Forget the football. Forget the quality, the disparity in this league, what we've achieved there is done by a group of special people and a special management team which has achieved something quite remarkable."
Huddersfield boss Mark Robins:
"It was the hardest 90 minutes that I've ever had to endure without a doubt.
"We were a million miles from our best, but we got what we needed at the end of it.
"The game doesn't really matter. It was the outcome that counted. When you've got a cup final, you've just got to get what you need.
"The job David Flitcroft has done is nothing short of miraculous because they were dead and buried in January."
- 01 Smithies
- 02 Woods
- 05 P Clarke Booked
- 06 Gerrard
- 32 Hunt
- 04 Norwood (Ward - 46' )
- 08 Clayton
- 10 Gobern (Southern - 46' Booked )
- 07 Scannell (Novak - 80' Booked )
- 18 Vaughan
- 21 Beckford
- 13 Bennett
- 03 Dixon
- 15 Wallace
- 11 Ward
- 24 Southern
- 09 Novak
- 19 Lee
- 01 Steele
- 14 Wiseman
- 25 Cranie
- 33 Kennedy
- 07 Dawson (Cywka - 84' )
- 08 O'Brien
- 11 Perkins
- 21 Mellis Booked (Noble-Lazarus - 66' Booked )
- 13 Dagnall (Scotland - 66' )
- 23 Etuhu
- 27 O'Grady Booked
- 12 Alnwick
- 15 McNulty
- 19 Cywka
- 09 Scotland
- 16 Harewood
- 24 Noble-Lazarus
- 32 Rose