David De Gea saved a penalty in the fifth minute of injury time taken by West Ham substitute Mark Noble, who was sent on purely to take the kick, as Manchester United held on for a 2-1 victory at the London Stadium.
A penalty was awarded via a VAR check after Jarrod Bowen saw his cross strike the outstretched arm of Luke Shaw.
Minutes earlier the failure of West Ham to sign last season's loan star Jesse Lingard came back to haunt them as the England striker curled an unstoppable curling strike into the top corner in the 89th minute.
The Hammers went in front on the half-hour mark when Said Benrahma aimed a shot from 20 yards to David De Gea's left only for it to be deflected by Raphael Varane just inside the goalkeeper's right-hand post.
The lead lasted just five minutes before Bruno Fernandes' fine inswinging cross from the left saw Cristiano Ronaldo beat the offside trap and though Lukas Fabianski saved the initial attempt on the volley, he could do nothing to stop the rebound nestling in the goal behind him as the Real Madrid legend scored for the third game in succession.
The Red Devils were overall worthy victors with Fernandes when the game was goalless seeing a shot tipped onto the post by Fabianski, who also raced from his line to deny a great chance for Ronaldo in the second half.
Had West Ham grabbed an equaliser United would have been particularly sickened as the Portuguese legend went to ground claiming a penalty three times in the latter stages of the game but on all occasions referee Martin Atkinson waved away his appeals.