Real Madrid has signed young Brazilian defender Eder Militao from Portuguese club Porto.

Madrid says the 21-year-old player signed a contract until June 2025 and will join the squad next season.

Militao had been playing with Porto since signing from Brazilian club Sao Paulo at the beginning of this season. He played 34 matches with the Portuguese champions, scoring three goals, including one in the group stage of the Champions League. He has been a key piece for a Porto team that has reached the quarterfinals of the European competition.

Roma midfielder Nicolo' Zaniolo, left, vies for the ball with Porto defender Eder Militao during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)
Roma midfielder Nicolo’ Zaniolo, left, vies for the ball with Porto defender Eder Militao during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)

Madrid says Militao is a quick defender who can play in the middle of the defense or as a right back. He can also help as a defensive midfielder if needed.

He made his debut with Brazil’s national team last year.

Real Madrid, again under coach Zinedine Zidane, hosts Celta Vigo in the Spanish league on Saturday.

Roma forward Diego Perotti, right, vies for the ball with Porto defender Eder Militao during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)
Roma forward Diego Perotti, right, vies for the ball with Porto defender Eder Militao during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)

___

Roma midfielder Steven N'Zonzi kicks the ball in front of Porto defender Eder Militao, left, during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)
Roma midfielder Steven N’Zonzi kicks the ball in front of Porto defender Eder Militao, left, during the Champions League round of 16, 2nd leg, soccer match between FC Porto and AS Roma at the Dragao stadium in Porto, Portugal, Wednesday, March 6, 2019. (AP Photo/Luis Vieira)