The 18-year-old midfielder has signed a six-year contract and will join Real at the end of the season.
A club statement read: “Real Madrid C.F. and Racing de Santander have reached an agreement for the transfer of the player Sergio Canales Madrazo.
“The contract, which will link the player to Real Madrid CF over the next six seasons, will enter into force from 1 July 2010.”
Arsenal, Chelsea, Manchester City and Manchester United were all reportedly interested in the youngster.