Mariano Diaz spent last season with Lyon and had been wanted by Sevilla, only for Real Madrid to exercise its buy-back clause.
Real Madrid have confirmed they have agreed a deal to re-sign Mariano from Lyon, just 12 months after he left the Santiago Bernabeu.
The Spaniard joined Lyon last summer for a fee reported to be in the region of €8m, but Real Madrid included a buyback clause in his contract giving them first refusal if the option to bring him back arose.
Eighteen goals in 34 Ligue 1 appearances last season piqued the interest of Real's La Liga rivals Sevilla, who had reached an agreement with Lyon for the transfer before Los Blancos exercised their contractual right.
Real announced the signing of Mariano in a statement which revealed that the player would be unveiled on Friday afternoon.
"Real Madrid CF and Olympique Lyonnais have agreed to the transfer of player Mariano, who remains linked to the club for the next five seasons," read the statement.
"The player will be presented this Friday, August 31, at 1:30 p.m., in the honor box of the Santiago Bernabéu stadium.
"Subsequently, Mariano will step on the lawn of the Santiago Bernabéu with the Real Madrid CF jersey and will attend the media in the press room."
It is understood that the fee agreed between the two clubs is around €23m. A 30% sell-on clause included in his contract allowed Real to get the deal done at a much cheaper rate than Sevilla would have been able to.
Mariano scored five goals in 14 first team appearances during his first spell at the club.