Real Madrid have announced that Spain coach Julen Lopetegui will coach the La Liga side after the World Cup.
Lopetegui, 51, is currently the coach of the Spanish national team due to feature at the 2018 World Cup in Russia.
The former goalkeeper fill the vacant seat at the Santiago Bernabeu after Zinedane Zidane resigned weeks ago.
Lopetegui's contract with Spain ran till 2020 after he signed a contract to extend his stay as the Spain Coach by two years.
A statement from Real Madrid said: “Julen Lopetegui will be the coach of Real Madrid after the 2018 World Cup in Russia.
“Real Madrid CF announces that Julen Lopetegui will coach the first team for the next three seasons.
“Julen Lopetegui will join the club after the participation of the Spanish team in the World Cup, after two years leading the national team.”
Lopetegui played for Real Madrid as a player once before he left the club. He also played for rivals Barcelona during his active playing career. He coached Madrid's feeder club Castilla in 2008/09 before he moved to coach the Spanish youth teams. Lopetegui coached Spain's U19, U20 and U21 before he joined Porto in 2014.
The timing of the announcement has been questioned as there are fears it could distract the Spanish national team at the World Cup but it is reported that Lopetgui requested the announcement himself to prevent unrest.
Lopetgui has a tough job of matching his predecessors record of three consecutive Champions League titles and a La Liga title. His first task will be to lead the UEFA Champions League winners to the FIFA World Club Cup in December.