"I would like to thank everyone at the club - the chairman, board, staff and players - and most of all the fantastic fans, who I hope understand this amazing career opportunity," read a statement from the Welshman.
"I'm not sure there is ever a good time to leave a club where I felt settled and was playing the best football of my career to date. I know many players talk of their desire to join the club of their boyhood dreams, but I can honestly say, this is my dream come true.
"I am well aware that I would not be at the level I am today were it not for firstly Southampton and then Spurs standing by me during some of the tougher times and affording me the environment and support they have.
"Tottenham will always be in my heart and I'm sure that this season will be a successful one for them. I am now looking forward to the next exciting chapter in my life, playing football for Real Madrid."
The Welsh international arrived at White Hart Lane from St Mary's Stadium in 2007 for an initial fee of £5m.