In another FA Cup match against Reading on 18 February, Hernández scored in the 72nd minute, giving United a 2–0 lead. His goal would end up being a deciding factor as United went on to win the game 2–1. Although he started in United's 2–0 Premier League victory against QPR on 23 February 2013, he did not score in the match and he didn't score again until 10 March in another FA Cup match against Chelsea which ended in a 2–2 draw. Hernández opened the scoring in manager Sir Alex Ferguson's final home game at Old Trafford against Swansea City. After a free kick was not cleared, he slotted in from six yards in the first half to put United 1–0 up, in a game they went on to win 2–1. Hernández scored United's last goal of the season and the final goal of the Ferguson era, when he tapped in a cross from close range in a 5–5 draw away at West Bromwich Albion on the final day. Hernández scored his first goal of the season under new manager David Moyes on 25 September 2013, netting the only goal of a home win over rivals Liverpool in the third round of the League Cup. On 26 October, with his first league goal of the campaign, he headed the winner as they came from behind to defeat Stoke 3–2 at Old Trafford. Three days later, he recorded a brace – starting with a penalty – in a 4–0 win against Norwich City in the next round of the League Cup. In the tournament's semi-finals, his goal from Adnan Januzaj's cross in the last minute of extra time forced a penalty shootout, which United lost to Sunderland. On 1 September 2014, Hernández signed for Real Madrid on a season-long loan deal, with an option of a purchase at the end of the loan. He underwent a medical and signed the contract that same day. He made his debut in the Madrid derby on 13 September, replacing Karim Benzema for the final 27 minutes as the team lost 2–1 at home to Atlético Madrid. On 19 September, Hernández came on as a 77th-minute substitute for Gareth Bale and scored his first two goals in an 8–2 away win against Deportivo de La Coruña. He scored the winning goal on 22 April 2015 in the 1–0 win over Atlético Madrid, which sent Real Madrid into the semi-finals of the Champions League.