Wayne Rooney was sent off for Manchester United as his side clung on to resolutely beat West Ham for their second league win of the season.
The home side were cruising after Rooney swept in a Rafael cross and Robin van Persie rifled in a low shot.
But Diafra Sakho nodded in for the Hammers before Rooney was sent off for a reckless tackle on Stewart Downing.
Enner Valencia shot wide and Kevin Nolan had an effort ruled out for offside as the home side held on.
The relief was palpable around Old Trafford at the final whistle, while there was also anger at referee Lee Mason for his decision to dismiss Rooney just before the hour mark.
However, the England striker kicked out at Downing as the Hammers threatened to launch a counter-attack and is now set to miss games against former club Everton, West Brom and Chelsea.
West Ham will be left to rue being on the wrong end of a close offside call when Nolanâ€™s last-gasp prod was disallowed but they have now lost 20 of their last 22 games at Old Trafford.
Manchester United boss Louis van Gaal had been looking for a response from his side following their 5-3 humbling at Leicester last Sunday and, although his side won, it was almost a similar story.
A defensive crisis had forced the Dutchman to draft 19-year-old Paddy McNair into central defence and Â£27m summer signing Luke Shaw in at left-back as the duo both made their club debuts.
But, for all of the home sideâ€™s struggles at the back, they still had a vast array of attacking artillery and it did not take long for that to fire.
Rafael raced down the right flank and delivered a cross which Rooney converted with a first-time glanced shot to the far post.
Van Gaal has questioned the England internationalâ€™s ability to play as a striker but Rooneyâ€™s finish was clinical and took his tally to 175 as he overtook Thierry Henry to move into the outright third position in the Premier Leagueâ€™s record of all-time top scorers.
The home side almost ruined their eye-catching forward play when a poor backpass from midfield released Enner Valencia on the home goal only for the Ecuadorian to blaze his effort over.
The Old Trafford sideâ€™s second came when Ander Herrera dispossessed Alex Song before Radamel Falcao slid a pass through to Van Persie, who angled in a right-foot shot.
But, Van Gaalâ€™s side had shown against Leicester that they have a propensity for hitting the self destruct button and they again made life difficult for themselves.
Referee Lee Mason denied the Hammers a penalty when Morgan Amalfitanoâ€™s hooked cross appeared to strike the arm of Falcao before the visitors pulled a goal back.
Home keeper David De Gea missed punching away a corner and, after Valenciaâ€™s header came back off the crossbar, Sakho was on hand to nod home for his fourth goal in five games.
Rooney red card then gave the visiting side hope but, despite a Sakho header into the side-netting and Nolanâ€™s late effort, Van Gaalâ€™s side hung on to close out the victory.
Source: BBC Sport