One of the longest running transfer sagas of the summer has finally come to an end after Tottenham Hotspur announced that they have reached an agreement with Real Madrid to sell Luka Modric.

A statement on the club's official website from the chairman, Daniel Levy, said: "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."

Modric, who made 160 appearances for the White Hart Lane side scoring 17 goals after joining from Dinamo Zagreb in the summer of 2008, is expected to cost the Madrid club around £30m. Modric passed his medical on Monday and is expected to sign a five-year contract.

The Real president, Florentino Pérez, said that he was "delighted" to welcome Modric: "The strong relationship and affinity between our two clubs has resulted in the cementing of a longer-term partnership and the successful transfer of Luka Modric. We are delighted to welcome Luka and look forward to working closely with Tottenham in the coming years."

Tottenham have announced that they have a signed a partnership with the Spanish club which "will see the two clubs working together in respect of players, coaching, best practices and commercial relationships".

The money raised from the Modric deal will fund Spurs' pursuit of the Brazilians Willian of Shakhtar Donetsk and Internacional's Leandro Damião.

Willian was left out of Shakhtar's squad for their league game against Karpaty on Sunday, with the coach Mircea Lucescu revealing he was not in the right frame of mind.

"Does anyone of you believe that in his current situation his head produces thoughts in the direction of right thinking?" he said to reporters. "I wouldn't like him to play and suffer an injury today, but this could happen. He will have some rest, and then we will see what to do with him.

"We have a week before the transfer window closes, during which, perhaps, everything will be solved."