Inter Milan have signed full-back Achraf Hakimi from Real Madrid, the two clubs announced on Thursday.
Inter will pay Madrid 40 million euros ($44.9 million) for Hakimi, with a further five million euros due in variables, according to reports in Italy.
The 21-year-old has signed a five-year contract with Antonio Conte's side.
Hakimi joined Madrid's youth set-up in 2006 but struggled to establish himself in the first team and has spent the last two seasons on loan at Borussia Dortmund.
He impressed in Germany but Zinedine Zidane was not convinced Hakimi could dislodge current Madrid right-back Dani Carvajal.
"Achraf Hakimi is officially an Inter player," read a statement from Inter Milan. "The Moroccan, who was born in 1998, has joined the Nerazzurri on a permanent basis from Real Madrid and has signed a contract which will last until 30 June 2025."
"Real Madrid and Inter Milan have agreed to transfer Achraf Hakimi," read a Madrid statement.
"The club wants to thank Achraf for all these years of dedication, professionalism and exemplary behaviour since he came to our academy in 2006 and wishes him good luck in his new phase."
Hakimi, who can also play as a winger, scored nine goals in 45 appearances in all competitions for Dortmund this season.