Spain's football federation named Julen Lopetegui as the new coach of the national team on Thursday, replacing Vicente del Bosque.
Del Bosque stepped down after eight years in charge following Spain's elimination in the round of 16 of the European Championship last month.
The 49-year-old Lopetegui had been without a job since January after being fired from FC Porto, his only head coaching job with a major club. He failed to win a title during almost two years in Portugal.
A former goalkeeper who started a handful of games for Real Madrid and Barcelona, Lopetegui played for Spain in the 1994 World Cup.
Lopetegui coached Spain's youth squads from 2010-14.
Del Bosque left after leading Spain's most successful generation of players to titles at the 2010 World Cup and the 2012 European Championship.
One of Lopetegui's main tasks will be to rebuild the team as many of its top players have started to fade. His familiarity with some of Spain's younger players from his stint as its youth team coach could help him move on from an aging group led by the 32-year-old Andres Iniesta.
In a statement to the federation's website, Lopetegui recognized the challenge ahead.
"A national team coach has very little time to transmit what he needs to a player before a big competition," Lopetegui said.
His first match will be Spain's friendly in Belgium on September 1. Four days later Spain starts its 2018 World Cup qualifying campaign with a home match against Liechtenstein.