Real Madrid have agreed to sign defender Eder Militao from Porto at the end of the season for his buy-out clause of 50m euros (£42.7m).

Both clubs announced the move on Thursday and the Spanish club say the 21-year-old Brazil international will sign a contract until 2025 with them.

The centre-back is Real Madrid's first signing following the return of Zinedine Zidane as manager.

Militao was signed by Porto from Sao Paulo in August 2018.

He has made 34 appearances this season and helped Portuguese champions into the Champions League quarter-finals.