The Champions League holders have announced on their official website that they have signed the Mexico international on a temporary basis
Madrid were in the market for a new striker following the exit of Alvaro Morata to Juventus earlier this summer and they have now found the back-up for main striker Karim Benzema that head coach Carlo Ancelotti had requested.
On Monday, Madrid confirmed the deal for the Mexico international, who has failed to nail down a first-team spot at Old Trafford.
"Real Madrid and Manchester United have reached an agreement over the loan deal of Javier "Chicharito" Hernandez, who will be playing for Madrid this season," a statement on the club's official website reads.
"Madrid have an option to buy the player outright.
"Javier Hernandez will be unveiled to the media in the press room Monday at 16:30CET."
The 26-year-old had joine United from Guadalajar in the summer of 2010 and had since made over 100 Premier League appearances for the Premier League outfit.
Nevertheless, he made the majority of his appearances coming off the bench due to the presence of Wayne Rooney and Robin van Persie at the club and he was keen to move on following the imminent arrival of Radamel Falcao from Monaco.
Hernandez won two Premier League titles during his time in England.