Brentford fell short in their bid for automatic promotion to the Premier League after a dramatic stoppage-time goal from Clarke Oduor which looks set to have saved Barnsley from relegation.
The Bees were chasing the goal which would have seen them leapfrog West Brom, who were held 2-2 by QPR, into second place. But they were caught on the break and substitute Oduor swept the ball home to spark jubilant scenes on the Barnsley bench.
The point keeps Barnsley out of the bottom three after Wigan's 12-point deduction for entering administration is applied - but the Latics are appealing that decision.
How Barnsley stunned Brentford
The Tykes had led through Callum Styles' strike shortly before the interval, before Brentford equalised through Josh Dasilva, and top scorer Ollie Watkins will not look back fondly on the late chance he squandered.
The Bees had won seven matches after the lockdown to cut the gap to West Brom from 10 points to just one, only to blow their big chance to go second with Saturday's agonising 1-0 defeat at Stoke.
- When are the Championship play-offs?
- Championship table | Fixtures | On Sky
- All Sky Sports channels for £18 a month
Nevertheless the scene was set for a memorable final game in Griffin Park's 116-year history, not least when news of West Brom's struggles began filtering through. However, they could not find the win they needed meaning their charming but tired old ground will host one more match, the second leg of the play-off semi-final against Swansea next week.
As the form team post-lockdown, Brentford should still fancy their chances of ending a 73-year wait for a place in the top flight, but these last two defeats will have hurt.
Barnsley arrived in west London harbouring only slim hopes of avoiding having to leave the Championship in the opposite direction but victory, coupled with Wigan's deduction, looks to have kept them up. It was a remarkable achievement considering they were 10 points from safety after a home loss to Birmingham in February.
Brentford almost drew first blood in the race for second when Rico Henry found Said Benrahma in the area. But the Algerian's powerful shot was kept out by Jack Walton at his near post with Watkins unable to convert the rebound.
Then word came through that first, fourth-placed Fulham, and then West Brom, had both fallen behind, leaving Brentford temporarily in pole position. But in the 41st minute they found themselves trailing as well. A poor defensive header fell to Styles and the 20-year-old clipped the ball home from 15 yards.
On the stroke of half-time Walton preserved Barnsley's lead with a stunning save to keep out Bryan Mbeumo's powerful first-time strike.
In the 72nd minute Brentford drew level after a scything run through the heart of the Barnsley defence from Benrahma.
The ball found its way to Dasilva towards the right-hand corner of the area and the midfielder curled his left-foot shot past the dive of Walton.
With West Brom now drawing, another goal would have put Brentford in the box seat again, but there were heads in hands when Watkins missed Benrahma's cross at the far post, and moments later Oduor arrived three yards out to tap in Barnsley's winner.
What the managers said:
Brentford's Thomas Frank: "Football is 80 per cent suffering and 10 per cent joy. When you have that opportunity to go direct to the Premier League, that is the emotional part of it - but Barnsley did a good job.
"Right now everything is tough but this is football and this is life. This was not straightforward.
"We can't sit down and cry too long because that will never help anything.
"We need to go again and pick ourselves up. We will have a sleep and then be ready to fight again."
Barnsley's Gerhard Struber: "We are safe!
"I think eight weeks ago I told my boys we need everyone in the squad and I think today Callum and Clarky scored the most important goals of the season.
"Now we are very happy with a big result, we are staying in the league. Now it's time to celebrate, have a big party, and not speak about the future. We are in the here and now. It's party time."