Rooney opened the scoring when he headed in Patrice Evra's cross on three minutes but James Morrison equalised with a long-range shot.

United survived when referee Chris Foy turned down a penalty claim after Gary Neville sent Graham Dorrans flying when the midfielder was clean through.

Peter Odemwingie later fired a penalty wide after Rio Ferdinand had fouled Jerome Thomas but Hernandez wrapped up the win with 15 minutes to go.