The 21-year-old played on loan for Real's B team Castilla in the second division for the second half of last season but also debuted with the senior squad under Jose Mourinho.
Local media reported the deal was worth 6 million euros.
Real also said on their website that their France striker Karim Benzema had undergone minor surgery to remove a cyst from his right knee on Monday.
Benzema underwent the procedure at the Centre Orthopedique Santy in Lyon, France, and was attended by Real's medical services, the club said.
Local media reported the 25-year-old was expected to be fit for the start of pre-season training at Real on July 15.