The Red Devils managed to seal the three points despite falling behind the home side in the first half of the clash.
Manchester United secured a win against West Ham amid a chaotic end to the Premier League match.
The Red Devils came from behind to get the three points, with Cristiano Ronaldo and Jesse Lingard dealing the decisive blows after Said Benrahma gave the home side the lead.
The game had an intense finish, with Ronaldo's call for a penalty in the 77th minute being waved away. With five minutes left to play, Ronaldo was again asking for a penalty when he claimed Aaron Cresswell pulled his jersey.
But United went ahead eventually when substitute Lingard popped up with a goal in the 89th minute, refusing to celebrate against the team he enjoyed an excellent loan spell at last season.
The drama did not stop there, though, as the Hammers were awarded a penalty in stoppage time.
But Mark Noble, who had just come on before the penalty, saw his effort saved by David de Gea and Ole Gunnar Solksjaer's team clinched the victory.
De Gea's penalty save was his first in over five years. The last time he saved a spot kick was in April 2016 and had conceded 40 since then until the decisive stop against Noble.