The 21-year-old will provide competition for veteran defender Sergio Ramos and World Cup victor Raphael Varane next season, as Madrid look to refresh an ageing squad under Zidane's leadership.
A statement on Real Madrid's website reads: "Real Madrid and Porto have agreed the transfer of the player Éder Militão, who will be linked to the club during the next six seasons, until June 30, 2025".
"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".
Militao, who can also play at right-back and has been capped once by Brazil, reinforces a Real defence that has often been diminished by injuries this season.
Robert Lewandowski hammers Bayern Munich's tactics in loss to Liverpool
This is the first time since 2011 that Bayern have failed to make the quarter-finals in Europe's top club competition. Information from Reuters was used in this report .
"He has been named the best defender in the league for the last five months in a row".
Yet the signing of Eder Militao from Porto helps to solve their defensive problems.
"His speed, positioning and anticipation are his greatest assets, while he is also strong in the air. Qualities that he has worn since his arrival last summer at Oporto, where he has shown a rapid adaptation to European football".
Those at the Santiago Bernabeu are hoping that he proves to be a shrewd addition for the future.
The Brazilian will arrive in the summer and means that Los Blancos now have four centre-backs they can rely on.