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.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.