The playmaker becomes Real's third summer signing after Dani Carvajal arrived from Bayer Leverkusen and Casemiro completed a permanent deal.
"Real Madrid and Malaga have reached an agreement for the transfer of Francisco Roman Alarcon Isco, who will be tied to the club for the next five seasons," said a statement on Madrid's website.
Isco, who has been on international duty in the European U21 Championship, will be presented on July 3 after undergoing a medical.
The 21-year-old previously admitted joining new boss Carlo Ancelotti's side would be an 'exciting option'.
Ancelotti was on Wednesday confirmed as Jose Mourinho's successor at the Santiago Bernabeu, and had to face questions at his press conference about possible new arrivals.
The likes of Tottenham Hotspur star Gareth Bale, Liverpool striker Luis Suarez and Napoli's Edinson Cavani are reportedly on Real's radar, while Cristiano Ronaldo has been linked with a move away from the club.
Ancelotti will be delighted to secure the services of Isco, who shone for Spain in their title-winning Under-21 campaign earlier in the summer.
Isco had previously admitted that the idea of following Manuel Pellegrini from Malaga to Manchester City appealed to him, but the lure of Real has proved impossible to resist.