The striker left Los Blancos for Lyon last year and went on to score 21 goals in 45 appearances last season.
The 25-year-old has now completed his return to the Spanish capital in a deal reportedly worth €30 million,
A statement on the club's website read:
Real Madrid C. F. and Olympique Lyonnais have agreed a deal for the player Mariano, who will be with the Whites for the next five seasons.
The player will be presented on Thursday 31st August, at 1:30pm CEST in the Santiago Bernabéu presidential box.
Mariano will then take to the Santiago Bernabéu pitch wearing the Real Madrid C. F. kit. He will then speak to the press in the press room.