MADRID — The Spanish soccer federation has extended the contract of national team coach Julen Lopetegui until 2020.

The federation made the announcement Tuesday, less than a week before Spain begins its preparations for next month's World Cup in Russia.

Lopetegui took over as coach after the team's elimination from the 2016 European Championship. He led the national team on an 18-match unbeaten streak and comfortably qualified for the World Cup in a group that included Italy.

Lopetegui was picked as Vicente Del Bosque's replacement mostly because of his success with Spain's youth squads. He won European championships with the under-19 and under-21 teams in the early 2010s.

Lopetegui had a lacklustre stint with Portuguese club Porto in his only job with a top team.