The Croatia midfielder, 26, will travel to Spain on Monday for a medical before signing a five-year contract.
Tottenham also announced they are entering a partnership with Real Madrid.
The agreement will see the two clubs working together in respect of players, coaching and commercial relationships.
“Luka has been a terrific player for us and, while we preferred not to part with him, we are pleased that it is to Real Madrid, a club with which we now look forward to sharing a long and productive partnership,” said Tottenham chairman Daniel Levy.
Modric joined Tottenham in 2008 in a £16.5m deal from Croatian side Dinamo Zagreb.
He made over 150 appearances for the London club, scoring 17 goals.
Real Madrid president Florentino Perez Rodriguez added: “We are delighted to welcome Luka and look forward to working closely with Tottenham in the coming years.”
Initially playing as a defensive midfielder under former manager Juande Ramos, Modric was moved into a more advanced role when Harry Redknapp became manager in October 2008.
He quickly developed into an integral part of the Tottenham side before being rewarded for his performances with a new six-year contract in 2010.
Last season, he made 41 appearances for Tottenham, scoring five goals.
Spurs boss Andre-Villas Boas has already stated his intention to add to his squad before the transfer window closes on Friday.
They have made three signings this summer, with Emmanuel Adebayor moving from Manchester City for £5m, midfielder Gylfi Sigurdsson joining from Hoffenheim and Jan Vertonghen signing from Ajax.