London, Jan 22: Marcus Rashford hit a last-gasp winner as Manchester United jumped ahead of West Ham in the race for the Champions League with a 1-0 Old Trafford success.
A drab game looked destined to end in goalless stalemate until Edinson Cavani's low cross from the left was turned in from close range by fellow substitute Rashford in the third minute of stoppage time.
Cavani appeared to be possibly offside when he collected a pass from Anthony Martial, but a VAR review allowed the goal to stand, leaving the Hammers devastated.
The result means West Ham manager David Moyes has now not won an away league match against his former club in 15 attempts (L11 D4).
Cristiano Ronaldo saw his unsubtle blast from an early free-kick go straight into the West Ham wall, and it looked like being that kind of day.
The 36-year-old Ronaldo failed to put his head on a dangerous cross from the left whipped over by Fernandes, before Diogo Dalot nodded a half-chance well wide, but the action was centred in midfield, with neither David de Gea nor Alphonse Areola having a shot to save before the break.
Ronaldo wanted a penalty when he went to ground under Kurt Zouma's challenge, expressing frustration as referee Jon Moss rejected the appeal.
West Ham had only won twice in 25 previous Premier League visits to Old Trafford (L20 D3), and they were looking for chances on the break as the hosts dominated possession.
Areola made the game's first save after 49 minutes when he pushed away a powerful 15-yard strike from Fred, before Bowen shot into the side-netting at the other end.
Raphael Varane headed narrowly over from a corner, and United replaced Anthony Elanga with Rashford just after the hour, Cavani joining the action later.
A game of healthy promise seemed to be fizzling out into nothingness, until the armada arrived. Ronaldo fed Martial who played in Cavani, and Rashford at the far post simply could not miss.