English winger Jack Harrison scored a hat-trick as Leeds United's bid for Premier League survival trumped West Ham's top-four race on Sunday in a pulsating five-goal showdown at London Stadium.
Harrison put the visitors ahead in London and netted again after Jarrod Bowen's equaliser.
When Pablo Fornals hauled West Ham level in the second half, Harrison had an instant response as the midfielder completed his treble.
Marcelo Bielsa's side made it two successive league victories to climb nine points clear of the relegation zone.
It was sweet revenge for Leeds, who were knocked out of the FA Cup in the third round at West Ham just a week ago.
"It was a beautiful game and very representative of the Premier League. It was a very tight triumph but it was deserved," Bielsa said.
"I'm very happy for Jack he puts in a lot of effort."
West Ham had won three consecutive league games and four in all competitions, but their bid to finish in the top four suffered a major setback thanks to Harrison.
David Moyes' team remain fourth, however, they are now just two points ahead of Arsenal, who have two games in hand, while Tottenham are four points back with four games extra to play.
Bemoaning a packed schedule that saw West Ham play three times in seven days, Moyes said: "People who play against Leeds will know the intensity you need to play.
"The players have been having a good go at it, today we were short but there were some mitigating circumstances.
"We had no games rearranged. I can't understand the Premier League squeezing a game in."
Leeds had scored just eight goals in nine away league fixtures this season, but Bielsa's men made a flying start and took the lead in the 10th minute.
Adam Forshaw found Harrison in the West Ham area and he drilled a fine finish that gave Lukasz Fabianski no chance.
Leeds' ongoing injury crisis was underscored by the presence of 15-year-old Archie Gray on the bench.
They suffered yet more fitness misery when Forshaw and Junior Firpo were both forced off with what looked like hamstring problems midway through the half.
Leeds' weakness at set-pieces was exposed in the 34th minute as Bowen headed West Ham's equaliser from another corner.
But Harrison had the perfect response three minutes later.
Luke Ayling headed the ball into Harrison's path and he bundled home from close-range.
West Ham equalised in the 52nd minute as Michail Antonio found Fornals, who got behind Ayling and guided a clinical finish past Illan Meslier.
But Harrison wasn't finished yet and the midfielder restored Leeds' advantage on the hour.
Raphinha slid a defence-splitting pass towards Harrison, who calmly clipped his shot over Fabianski to bag his treble.
Meslier made a superb double save to deny Vladimir Coufal and Bowen in a tense finale.
Andriy Yarmolenko had one last chance to equalise in stoppage-time but Meslier was equal to it as Leeds held on.