The move comes after Casemiro’s impressive season with the club which reached the quarter-finals of the Champions League persuaded Porto to take up the option they had to make the loan deal permanent for $16.5 million, Xinhua reported on Friday.
However, Real have decided to pay 7.5 million euros to the Portuguese club in order to bring him back to Spain.
The complicated original deal means that should Real look to cash in on Casemiro by selling him on this summer, or including him in a deal to bring in another player, they would have to pay Porto a further 7.5 million euros, all of which implies Casimiro will form part of the squad coached by Rafa Benitez next season.
The 23-year-old made 28 league starts for Porto last season, scoring three goals, but also seeing 13 yellow cards, while the previous campaign he had one start and 11 substitute appearances, clocking up less than 300 minutes league football.
His return will help fill the gap left by the departure of German international Sami Khedira, who is out of contract, and will probably open the door for Asier Illaramendi to leave the club over the coming months.