Real Madrid have announced that the Spain head coach Julen Lopetegui will take over as manager at the Bernabéu after 2018 World Cup in Russia.

Lopetegui has signed a three-year deal with Madrid after two years with the national side, who he has guided to the World Cup in impressive fashion.

The timing of the announcement is unexpected, given that Spain kick off their tournament on Friday when they face Portugal in Sochi.

Lopetegui, 51, played for Real between 1988 and 1991 as a goalkeeper, making one league appearance, and later turned out for rivals Barcelona a handful of times. He also coached the B team, Castilla, in 2008-09 before joining the national setup as Spain Under-19 coach.

In May, he signed a two-year extension to remain as Spain coach until 2020 but the call of Madrid has proved stronger.