The 21-year-old Brazilian is a player who has registered on the transfer radar of those at the Santiago Bernabeu for some time.
An agreement is now in place, with the Blancos having got their man.
Militao becomes the first addition made during Zinedine Zidane’s second reign in the Spanish capital, with the Frenchman having moved quickly to land a top target upon returning to Real.
A statement released by Madrid on their official website read: “Eder Gabriel Militao is officially a new Real Madrid player, signing until 2025.
"The 21-year-old defender will join the club next season and is already a full Brazil international.
“He comes to the Whites from Porto, where he has quickly become a star of the team in only his first year in the Portuguese League. He has been named the best defender in the league for the last five months in a row.
“A versatile footballer, Militao plays largely as a centre-back although he has also spent time at right-back. His speed, positioning and anticipation are his greatest assets, while he is also strong in the air.
"These qualities have been on consistent display since his arrival at Porto last summer as he has adapted swiftly to the European game.”
Militao only arrived in European football during the summer of 2018.
Porto acquired him from Sao Paulo and handed him a five-year contract.
He will have seen out less than 12 months of that agreement before heading to Madrid.
Those at the Santiago Bernabeu are hoping that he proves to be a shrewd addition for the future.
A man who made his senior international debut for Brazil in September 2018 will join a defensive unit in Spain which has been far from watertight this season.
The Blancos have endured a difficult campaign as a result, with Zidane becoming the third man to fill their managerial hot-seat.
He has enjoyed considerable success in that role before and will be hoping to see Militao help to deliver more once welcomed into the Real fold.
For now, the South American is chasing down major honours with Porto, with the Portuguese giants waiting to discover who they will land in the Champions League quarter-finals when the draw for the last eight is made on Friday.