Sevilla on Tuesday signed Julen Lopetegui, who was sacked as Spain coach on the eve of the 2018 World Cup, as manager for the next three seasons.

The 53-year-old, who had been out of work since Real Madrid fired him at the end of October after a poor start to the season, will take over from Joaquin Caparros.

He will be officially unveiled as Sevilla’s new coach on Wednesday, the club said in a statement.

Caparros, who has been diagnosed with chronic leukemia, announced at the end of the season that he would be stepping down.

Real Madrid fired Lopetegui after the club lost 5-1 against arch rivals Barcelona.

His time as Real coach lasted just 139 days, with his decision to join the club also costing him his job as Spain boss at the 2018 World Cup in Russia.

The Spanish football federation sacked Lopetegui in June 2018 just two days before Spain’s opening game with Portugal after it emerged that he had signed with Real without their knowledge.

The former Real Madrid goalkeeper has also coached Rayo Vallecano and Porto at the club level.