The Champions League winners declined to disclose the details of the deal but it understand that they had to pay a touch more than the Frenchman's €24m (£21m, $27m) release clause to avoid damaging their relationship with their local sparring partners.
The 19-year-old left-back has been the subject of a big summer battle between the two La Liga giants after enjoying an impressive campaign on loan at Alaves.
Reports in Spain in April said that Real Madrid were ready to meet his release clause after having identified him as the long-term replacement of Marcelo.
However, Barcelona joined the race days later amid suggestions that Los Colchoneros would rather see him move to the Nou Camp than the Santiago Bernabeu.
It was reported that Theo was still likely to make the move to Real Madrid. But in May his agent, Manuel Garcia Quilon, refused to confirm those intentions, stating that Barcelona had also made an offer to sign his client.
Yet, last week the France starlet all but confirmed that he was going to move to Real Madrid after controversially admitting that playing for the Atletico neighbours had been his dream since childhood.
The deal was thus just only a formality and Real Madrid have now made it official with the player agreeing a six-year-deal at the Bernabeu.
"Real Madrid C.F. and Atlético de Madrid have agreed the transfer of the player Theo Hernández, who will be contracted to the club for the next six seasons," the club have confirmed.
"The player will be presented next Monday, 10 July at 7:30 pm, in the presidential box at the Santiago Bernabéu stadium, after undergoing the corresponding medical examination.
Later, Theo Hernández will step out on to the pitch at the Santiago Bernabéu for the first time in the Real Madrid shirt and will speak to the media in the press room."
Theo will fill the gap left by Fabio Coentrao after the Portugal international completed a loan move to Sporting Clube de Portugal earlier on Wedsnesday (5 July).
The news is a fresh transfer blow for Barcelona after Real Madrid also beat them to the signing of Brazilian wonderkid Vinicius de Oliveira Junior from Flamengo.
Meanwhile, the two La Liga giants are currently involved in another major battle to sign Real Betis sensation Dani Ceballos.