David de Gea saved his first penalty in the Premier League since October 2014 on his 22nd attempt
Mark Noble stepped off the bench for an injury time penalty - and saw it saved - as Jesse Lingard's stunning late goal secured victory for Manchester United against his former club West Ham.
Lingard, who spent a successful loan spell at London Stadium last season, appeared as a substitute in the second half and with two minutes remaining he cut on to his right foot and fired into the top corner.
Further drama followed as Luke Shaw was adjudged to have handballed in the box and De Gea dived the right way to push away the spot-kick that had been taken by Noble, who was making his first touch after coming off the bench in the 95th minute.
Earlier in the contest, Cristiano Ronaldo had converted his fourth goal in three games since re-signing for Manchester United, poking home from close range on 35 minutes after Lukasz Fabianski had spilled the initial effort.
West Ham had taken the lead five minutes before that when Said Benrahma's strike from outside the area went in after taking a huge deflection off defender Raphael Varane.
Bruno Fernandes had seen a first-time strike superbly tipped on to the post by Fabianski, who made a string of saves for the home side.
Victory ensures Ole Gunnar Solskjaer's side remain unbeaten in the league this term with four wins and a draw, while West Ham suffered their first loss of the campaign.
- Follow live text coverage of Sunday's Premier League actionVisit the West Ham United pageVisit the Manchester United page
Man Utd preserve unbeaten run on the road
The Red Devils were heavily criticised after a poor Champions League performance in Switzerland against Young Boys in midweek and were looking like being left frustrated in London.
But instead they maintained their incredible run away from home in the league and are now unbeaten in their last 29 top-flight games outside Old Trafford.
The game was meandering towards a draw until Lingard popped up to score superbly and the England international did not celebrate after being given a good reception by the home supporters.
The return of Ronaldo seems to be an inspired move by Solskjaer as the Portugal international continued his impressive return and he could have had more goals, as well as having a number of penalty appeals turned down.
Ronaldo flashed a shot straight at Fabianski and another effort was brilliantly tipped wide by the Polish goalkeeper, who also kept out efforts from Luke Shaw and Aaron Wan-Bissaka.
West Ham forwards Nikola Vlasic and Pablo Fornals both flicked efforts wide from promising positions and David Moyes' side had a golden opportunity to claim a point in the dying seconds.
Andriy Yarmolenko's cross hit Shaw's outstretched arm and referee Martin Atkinson awarded the penalty after viewing the incident on the pitchside monitor.
Declan Rice initially took the ball but Noble came on for Jarrod Bowen and assumed responsibility, but his effort was brilliantly saved by De Gea.
Player of the match
with an average of 7.67
- West HamWest Ham UnitedWest Ham UnitedMan UtdManchester UnitedManchester United
West Ham UnitedAvgSquad number41Player nameRiceAverage rating
Squad number22Player nameBenrahmaAverage rating
Squad number4Player nameZoumaAverage rating
Squad number20Player nameBowenAverage rating
Squad number28Player nameSoucekAverage rating
Squad number1Player nameFabianskiAverage rating
Squad number21Player nameOgbonnaAverage rating
Squad number8Player nameFornalsAverage rating
Squad number5Player nameCoufalAverage rating
Squad number3Player nameCresswellAverage rating
Squad number11Player nameVlasicAverage rating
Squad number7Player nameYarmolenkoAverage rating
Squad number10Player nameLanziniAverage rating
Squad number16Player nameNobleAverage rating
Manchester UnitedAvgSquad number14Player nameLingardAverage rating
Squad number7Player nameCristiano RonaldoAverage rating
Squad number1Player namede GeaAverage rating
Squad number18Player nameBruno FernandesAverage rating
Squad number31Player nameMaticAverage rating
Squad number23Player nameShawAverage rating
Squad number19Player nameVaraneAverage rating
Squad number25Player nameSanchoAverage rating
Squad number11Player nameGreenwoodAverage rating
Squad number6Player namePogbaAverage rating
Squad number29Player nameWan-BissakaAverage rating
Squad number39Player nameMcTominayAverage rating
Squad number5Player nameMaguireAverage rating
Squad number17Player nameFredAverage rating
- Line-upsMatch StatsLive Text
- 1Fabianski5Coufal4Zouma21Ogbonna3Cresswell8Fornals28Soucek41Rice11VlasicSubstituted forYarmolenkoat 68'minutes20BowenSubstituted forNobleat 90+4'minutes22BenrahmaSubstituted forLanziniat 88'minutes
1de Gea29Wan-Bissaka19Varane5Maguire23Shaw39McTominay17Fred11Greenwood18Bruno Fernandes6Pogba7Cristiano Ronaldo
- 1de Gea29Wan-Bissaka19Varane5Maguire23Shaw39McTominay17FredSubstituted forMaticat 88'minutes11GreenwoodSubstituted forSanchoat 73'minutes18Bruno Fernandes6PogbaSubstituted forLingardat 73'minutes7Cristiano Ronaldo
- 3Bailly8Mata9Martial14Lingard20Dalot22Heaton25Sancho31Matic34van de Beek
Referee:Martin AtkinsonMatch StatsHome TeamWest HamAway TeamMan UtdPossessionHome39%Away61%ShotsHome13Away17Shots on TargetHome4Away10CornersHome2Away11FoulsHome5Away8Live TextPost update
Match ends, West Ham United 1, Manchester United 2.
Second Half ends, West Ham United 1, Manchester United 2.
Penalty saved! Mark Noble (West Ham United) fails to capitalise on this great opportunity, right footed shot saved in the bottom right corner.
Substitution, West Ham United. Mark Noble replaces Jarrod Bowen.
VAR Decision: Penalty West Ham United.
Penalty conceded by Luke Shaw (Manchester United) with a hand ball in the penalty area.
Foul by Luke Shaw (Manchester United).
Jarrod Bowen (West Ham United) wins a free kick in the attacking half.
Goal! West Ham United 1, Manchester United 2. Jesse Lingard (Manchester United) right footed shot from the left side of the box to the top right corner. Assisted by Nemanja Matic.
Substitution, West Ham United. Manuel Lanzini replaces Saïd Benrahma.
Substitution, Manchester United. Nemanja Matic replaces Fred.
Attempt missed. Pablo Fornals (West Ham United) right footed shot from outside the box misses to the left following a corner.
Corner, West Ham United. Conceded by David de Gea.
Attempt saved. Bruno Fernandes (Manchester United) right footed shot from outside the box is saved in the centre of the goal. Assisted by Jesse Lingard.
Substitution, Manchester United. Jesse Lingard replaces Paul Pogba.
Substitution, Manchester United. Jadon Sancho replaces Mason Greenwood.
Raphaël Varane (Manchester United) wins a free kick in the defensive half.
Foul by Jarrod Bowen (West Ham United).
Attempt blocked. Saïd Benrahma (West Ham United) right footed shot from outside the box is blocked. Assisted by Andriy Yarmolenko.
Hand ball by Luke Shaw (Manchester United).
Page 1 of 5rewindpreviousNavigate to the next pagenextNavigate to the last pageforward
- 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