Ukraine international Andriy Yarmolenko was emotional as he scored the opener against Aston Villa in his first West Ham appearance since the outbreak of war in his native country.
The 32-year-old brought an otherwise disappointing game to life when he controlled Said Benrahma's pass with his right foot before firing past Emiliano Martinez with his left.
Substitute Yarmolenko, who replaced Michail Antonio in the second half, shed tears as he dropped to his knees in celebration.
He was welcomed on to the field with a warm reception from both sets of supporters, and some Aston Villa fans even applauded as he was embraced by his team-mates for the goal.
The Hammers were lifted after taking the lead and Pablo Fornals sealed victory when he powered Benrahma's cutback past Martinez.
Villa arrived in the capital off the back of three impressive wins but they had to settle for a Jacob Ramsey consolation late on.
The visitors were denied taking the lead when Danny Ings' effort was tipped onto the post by Lukasz Fabianski before the ball came harmlessly back to the West Ham goalkeeper.
Victory for the hosts ended a run of three defeats in all competitions and lifted them to fifth in the table, while Villa remain ninth.