Ruud van Nistelrooy marked his return to the Manchester United starting line-up with the only goal of the match as his team deservedly beat West Ham.
Van Nistelrooy scored his 149th goal in United colours
Van Nistelrooy, a substitute for the last five games, smashed Ji-Sung Park's pass into the bottom corner from eight yards in first-half injury time.
Nemanja Vidic and Wayne Rooney both hit the post while Shaka Hislop saved from Gerard Pique and Van Nistelrooy.
Dean Ashton could not deflect a Lionel Scaloni shot goalwards for West Ham.
United have won their last seven Premiership matches and move to within nine points of leaders Chelsea while taking a five-point lead over Liverpool in the race for second place.
But despite outperforming their opponents for the bulk of the match United, with five changes from the team that defeated Birmingham, started poorly.
Matthew Etherington shot over from 20 yards, while Edwin van der Sar saved from Hayden Mullins and then palmed a teasing corner into the path of Scaloni as West Ham dominated the early stages.
Scaloni smashed his shot straight at Ashton, who could not guide the ball home from close range.
Cristiano Ronaldo went down under a heavy challenge from Danny Gabbidon as United finally found some rhythm but referee Graham Poll, who limped off injured shortly afterwards, waved play on.
Hislop spilled a swerving free-kick from Ronaldo but claimed at the second attempt, while Darren Fletcher shot wide after a clever pass from Rooney as United started to impose themselves on the match.
Pique almost marked his full Premiership debut with a goal but his long-distance effort was thwarted by a superb save, while Vidic looked to have scored but his low shot through a congested penalty area hit the post.
West Ham pushed on when possible - Van der Sar saving from Harewood and Patrice Evra making a timely clearance with Ashton lurking.
But United went ahead through Van Nistelrooy on the stroke of half-time, the Dutchman converting Park's cutback after the Korean had skipped Paul Konchesky's challenge.
Van Nistelrooy, skippering the home team, almost scored his 150th goal for United early in the second half but was denied by Hislop.
Hislop saved a deflected Ronaldo shot as United, increasingly dominant, hit West Ham on the break.
Ronaldo showcased his repertoire of skills as Konchesky endured a difficult evening, though the West Ham defender almost crossed for Harewood to equalise but the striker just failed to make a decisive contact.
United remained in command throughout the second half, with Rooney hitting the post and Van Nistelrooy forcing a decent save with a bicycle kick from the subsequent rebound.
Manchester United manager Sir Alex Ferguson:
"It was a very open game, both teams had a go and we played some fantastic attacking football.
"We should have had more goals but we collected another three points and that takes us five above Liverpool.
"The most important thing is that we keep winning - and you never know where that will take us."
West Ham manager Alan Pardew:
"We gave an honest account of ourselves but from our part it could have been slightly better.
"This is a big stage, they have some very good players and we find them in good form so it was a tough ask for us.
"Sometimes you have to have a little bit of devilment in your game. I thought that we lacked that, not just individually but also as a team."
Man Utd: Van der Sar, O'Shea, Vidic, Ferdinand, Evra (Silvestre 78), Ronaldo (Saha 87), Fletcher (Giggs 69), Pique, Park, van Nistelrooy, Rooney.
Subs Not Used: Howard, Rossi.
Goals: van Nistelrooy 45.
West Ham: Hislop, Scaloni (Ferdinand 67), Collins, Gabbidon, Konchesky, Benayoun, Reo-Coker, Mullins, Etherington (Zamora 80), Ashton (Sheringham 80), Harewood.
Subs Not Used: Walker, Fletcher.
Ref: G Poll (Hertfordshire).