Match ends, West Ham United 2, Leeds United 3.
Jack Harrison scored his first career hat-trick as Leeds United avenged last week's FA Cup defeat with a thrilling Premier League victory over West Ham at London Stadium.
The visitors, who lost 2-0 seven days ago, were pegged back twice before Harrison scored the pick of his three goals with a neat chip over Lukasz Fabianski as Leeds made it consecutive league wins for the first time this season.
"This was a typical Premier League game," said Leeds boss Marcelo Bielsa. "It was good that it went in our favour but the margin was very close.
"It is a triumph for the players because of the effort they put in. The desire to win was very, very big."
Harrison opened the scoring with a fierce strike in the 10th minute but West Ham recovered from their lacklustre start to equalise through the in-form Jarrod Bowen.
Leeds took the lead again before the interval as Harrison sneaked in at the back post to convert off his thigh from Luke Ayling's downward header following a corner.
Pablo Fornals scored his first goal since November to draw the Hammers level for a second time in the 52nd minute, but Harrison sealed victory eight minutes later.
Bowen, who had earlier scored his fourth goal in three games, missed a golden chance in the final seconds to draw the hosts level as he could only chest the ball over the bar from a few yards when unmarked.
That came after both sides had goals ruled out as first, Mateusz Klich's effort was crossed off as it brushed an offside Rodrigo on its way in, before Andriy Yarmolenko's header was deemed offside
Bielsa's side move up one place into 15th, nine points clear of the relegation zone, although 18th-placed Norwich City have also played a game more.
West Ham remain fourth but the group of clubs in the chasing pack all have games in hand. Fifth-placed Arsenal are two points behind having played two games fewer.
- Follow live text commentary of West Ham United v Leeds United, plus the rest of Sunday's Premier League action
- Go straight to the best Hammers content
- Visit our Leeds page
What a difference a week makes
West Ham were deserved winners in the third round cup tie between the sides - a game which saw them produce 17 shots to eight for the visitors.
But while the Hammers were in midweek action against Norwich City, Leeds did not play and they were full of running in the early stages. With much-needed league points at stake, they took control and an early lead.
Klich's stinging shot was parried by Fabianski and Harrison was the beneficiary as he fired Adam Forshaw's knock-back into the far corner.
The Hammers were not at their fluid best but their threat remained from set-pieces as Craig Dawson headed inches wide. If that was a warning shot, Leeds failed to learn their lesson as Bowen evaded his marker to head in the equaliser from the following 34th-minute corner.
Harrison claimed his second three minutes later as he ghosted in unmarked at the back post to turn Ayling's header in. It was no more than Leeds deserved as they dominated with 61% possession in the first half.
The hosts responded well as Fornals cut in on his right and wrong-footed Illan Meslier with the finish.
But with the game in the balance, Raphinha produced a moment of brilliance to slice open the Hammers defence with a through-ball for Harrison to lift over the onrushing Fabianski and complete a brilliant treble.
"I have to give credit to the players to play Leeds last week and then a game in midweek. An excuse? Maybe, but a bit of a fair one," said Hammers boss David Moyes.
"People who play against Leeds will know the intensity you need to play. We knew we had them in the league after the FA Cup but then the Premier League stuck the game in midweek.
"We found it difficult to get prepared quickly. We made mistakes, no-one else's fault, but there were other reasons for it as well."
- 23DiopSubstituted forPerkinsat 87'minutes
- 10LanziniBooked at 62mins
- 8FornalsSubstituted forYarmolenkoat 69'minutesBooked at 77mins
- 11VlasicSubstituted forMasuakuat 61'minutes
- 9AntonioBooked at 24mins
- 3FirpoSubstituted forHjeldeat 23'minutes
- 5KochBooked at 45mins
- 4ForshawSubstituted forBateat 22'minutesSubstituted forRodrigoat 65'minutes
- 20JamesBooked at 88mins
- Mike Dean
- Shots on Target
Second Half ends, West Ham United 2, Leeds United 3.
Attempt missed. Jarrod Bowen (West Ham United) with an attempt from very close range is just a bit too high following a set piece situation.
Foul by Stuart Dallas (Leeds United).
Michail Antonio (West Ham United) wins a free kick on the left wing.
Attempt saved. Andriy Yarmolenko (West Ham United) left footed shot from outside the box is saved in the bottom left corner. Assisted by Manuel Lanzini.
Foul by Daniel James (Leeds United).
Craig Dawson (West Ham United) wins a free kick in the defensive half.
Attempt blocked. Craig Dawson (West Ham United) header from the centre of the box is blocked. Assisted by Aaron Cresswell with a cross.
Daniel James (Leeds United) is shown the yellow card for a bad foul.
Corner, West Ham United. Conceded by Stuart Dallas.
Substitution, West Ham United. Sonny Perkins replaces Issa Diop.
Foul by Leo Fuhr Hjelde (Leeds United).
Andriy Yarmolenko (West Ham United) wins a free kick on the right wing.
Attempt saved. Vladimir Coufal (West Ham United) header from the centre of the box is saved in the top centre of the goal. Assisted by Michail Antonio with a cross.
Offside, West Ham United. Vladimir Coufal tries a through ball, but Jarrod Bowen is caught offside.
Attempt saved. Vladimir Coufal (West Ham United) left footed shot from the centre of the box is saved in the bottom right corner.
Attempt blocked. Raphinha (Leeds United) left footed shot from outside the box is blocked.
Andriy Yarmolenko (West Ham United) is shown the yellow card for a bad foul.
Daniel James (Leeds United) wins a free kick in the attacking half.
- Our coverage of your Premier League club is bigger and better than ever before - here's everything you need to know to make sure you never miss a moment