The two club presidents met in Milan to thrash out details of the package that will free Mourinho to leave Inter and join the nine-times European champions after a treble-winning season in Italy.
Inter gave no details of the deal between their president Massimo Moratti and his Real counterpart Florentino Perez but Spanish and Italian media reported that Inter would receive eight million euros (6.8 million pounds).
Mourinho led Inter to three trophies last season, culminating in their Champions League final victory over Bayern Munich at Real's Bernabeu Stadium.
Real turned to him after sacking Manuel Pellegrini this week following a season with no trophies for a team that had 250 million euros spent on it last summer.
"We are convinced that we need a fresh impulse and we are convinced that Jose Mourinho is the right person to take on the job," Perez said at the time.
The move for Mourinho marks a change in direction for Perez, who has preferred to invest money in the world's best players rather than high-profile coaches in the past.
STRONG MAN
"(We looked to Mourinho) for his prestige, for the personality he has, for his great ability to absorb the pressure and for the leadership Madrid needs," Perez's right-hand man Jorge Valdano said in a radio interview earlier on Friday.
"We lacked a strong man in a moment of transition like this."
Real tripped up in the big games last season, losing in the 'clasicos' against Barcelona and in the Champions League first knockout round against Olympique Lyon.
Mourinho, 47, has a reputation as a motivator, is a great tactician and is strong enough to ride out the inevitable ups and downs of managing a side under the local media's microscope.
With Porto he won the UEFA Cup and the European Cup in 2004, and he won back-to-back league titles with Chelsea before moving to Italy.
He will be expected to get the most out of compatriot Cristiano Ronaldo but is likely to demand more of a say in planning at the club.
Pellegrini spoke of being isolated from the decision-making process when it came to planning the team, and Jose Antonio Camacho walked out on the club in 2004 complaining of interference in team affairs from above.
Spanish media have already speculated that Real will move back into the transfer market, with Inter's Brazilian fullback Maicon and Benfica's Argentine winger Angel Di Maria among the names linked with the club.
Barcelona take bus for Inter Milan semi-final
Real Madrid win thriller, go top of La Liga
Seria A: Inter Milan draw with Palermo
Real Madrid to make 20 million pound bid for Vidic
Lyon dump Real Madrid out of Champions League