Stat Attack: All you need to know about Brentford 1-2 Leeds
Jack Harrison's stoppage-time strike secured a 2-1 triumph at 10-man Brentford, as Leeds avoided relegation from the Premier League on a dramatic final day of the season.
The Whites thought they were ahead inside 20 minutes but Joe Gelhardt's attempt was ruled out by VAR for offside.
However, the visitors took the lead early in the second half, when Raphinha dispatched a 56th-minute penalty after he was fouled by Bees goalkeeper David Raya.
The hosts then drew level in the 78th minute, as Sergi Canos found space at the back post to head the ball past Illan Meslier.
But the Spaniard was booked for his celebration and received a second yellow just two minutes later, as Thomas Frank's side were reduced to 10 men.
Jesse Marsch's outfit pushed for a winning goal and ultimately sealed their safety thanks to a terrific 94th-minute effort from Harrison to send the away end into pandemonium.
And the American manager was understandably delighted after the match.
He said: "This group has been able to dig deep in injury time and find goals and the character is clear and it's a privilege to work with these guys.
"It's hard to concentrate and be connected for 90 minutes on days like this but this is typical of our group — they never stop believing and it's a credit to our mentality.
"I love this group, team, character, commitment and spirit."
Despite this defeat, Brentford have enjoyed an impressive debut Premier League campaign — and midfielder Christian Eriksen provided a positive assessment of the Bees' season.
He said: "Overall I think everyone can be very pleased with what they have achieved.
"In a first year in the Premier League we know how difficult it is.
"We have been on a good run and after a few hours I think everyone will settle down and be in a good mood."
Did you know?
Leeds named their youngest starting XI in terms of average age in the Premier League this season against Brentford (25 years, 242 days).
Canos is the third player to score and be sent off in a Premier League game this term.
The Whites have scored each of the last 18 penalties they have taken in the top flight.
Raphinha has been directly involved in 14 league goals this season (11 goals, three assists) — at least five more than any other Leeds player.
Each of the last five Premier League debutants have lost their final game of the season (Cardiff, Bournemouth, Brighton, Huddersfield and Brentford).