A week ago, manager David Moyes had seen his players humiliated 3-0 at home by Liverpool, but United recovered to overturn a 2-0 first-leg deficit against Olympiakos in mid-week to reach the Champions League quarter-finals.
Robin van Persie had been the star that night with a hat-trick, but he was also injured in that game, allowing Rooney to regain top billing with a brace at Upton Park.
And he did so with an opening goal worthy of a Hollywood script by emulating former United hero David Beckham by beating the goalkeeper from astonishing range.
It was not quite as far out as Beckham’s famous halfway-line lob against Wimbledon in 1996, but the former England captain just so happened to be in the stands to watch it go in.
Moyes’s starting line-up caused plenty of eyebrows to be raised as Alexander Buttner, Shinji Kagawa and Ashley Young all started and Michael Carrick, a former West Ham midfielder, was employed in central defence.
Carrick was drafted in to replace the suspended Nemanja Vidic, with Marouane Fellaini detailed to help him cope with home striker Andy Carroll at set-pieces.
Rio Ferdinand, who also began his career at Upton Park, was ruled out by a back injury, while England forward Danny Welbeck could only make the bench.
United started strongly. Carroll stopped Fellaini’s header on the line in the third minute after the Belgian had been picked out in the box by Young and it was not long before home goalkeeper Adrian was required to stop a shot from Juan Mata.
Then came Rooney’s moment of genius in the eighth minute as he nudged Hammers defender James Tomkins out of the way just inside the hosts’ half on the right before lofting a shot over Adrian from almost 60 yards.
– Rooney reaches milestone
West Ham replied with high balls aimed at Carroll, who headed a free-kick just wide and found United goalkeeper David de Gea with another header after Stewart Downing had got the better of Rafael da Silva.
Kagawa had the chance to double United’s lead, but fired straight at Adrian, as did Mata soon afterwards. Mata was operating in the hole behind Rooney and was a constant menace to the West Ham back-line.
West Ham captain Kevin Nolan felt he should have had a penalty when he went down under Darren Fletcher’s challenge, but play continued, allowing United to score on the counter-attack in the 33rd minute.
Young fired in a cross from the right that Mark Noble hoofed away from goal, but the ball hit the onrushing Rooney on the shin and flew into the net.
It was Rooney’s 212th United goal, taking him above Jack Rowley into third place on the list of the club’s all-time leading scorers, behind only Bobby Charlton (249) and Denis Law (237).
The home side were visibly deflated by the setback and allowed Rooney a chance to claim his hat-trick before half-time.
This time, however, his connection from the edge of the box was wild and the ball almost went out for a throw-in.
The second half was not so memorable as West Ham won a series of corners, but could not turn them into goals.
United, for their part, were content to keep possession whenever possible, but the urge to add to their lead was only intermittent.
Fellaini burst through late on and went down in the box under a challenge from Antonio Nocerino, the West Ham substitute, but no penalty was awarded.