The defender, who will join in the summer, is 21 years old and is a full global with Brazil.
Militao has signed a six-year deal at the Bernabeu, with Madrid confirming he has committed his future to the club until 2025.
Militao has had an excellent first season in Europe, becoming a key part of the Porto squad and starting 20 league and seven Champions League matches, scoring three goals in the process.
"Multi-purpose player, Militao plays central, although he has also occupied the right-back position".
SEGA Stops Selling Judgment Due to Cocaine Scandal
Side note: if you aren't from Japan, this probably sounds like a lot of trouble over some fairly routine drug charges. This was because the original actor Hiroki Narimiya had retired in 2016, following allegations of cocaine abuse.
The player could yet the be the start of a summer splurge at Real after Zinedine Zidane's unexpected return to the club this week.
"These qualities have been on consistent display since his arrival at Porto last summer as he has adapted swiftly to the European game".
Militao was previously signed from Sao Paulo where he played in the 2017/18 season.
He is also a full Brazil worldwide and made his debut against El Salvador in September 2018.