Luis Enrique, whose daughter died from bone cancer in August, is returning as Spain manager five months after stepping down for personal reasons.
Enrique resigned in June after 11 months in the job and announced in August that his nine-year-old daughter, Xana, had died.
The 49-year-old former Barcelona boss was replaced by his assistant, Robert Moreno.
Moreno was in charge as Spain beat Romania 5-0 on Monday.
It saw Spain wrap up qualification for Euro 2020 without losing a game.
Moreno, who also worked under Enrique at Roma, Celta Vigo and Barcelona, said after taking the job he would “step aside” if Enrique ever wanted to return.
At a news conference on Tuesday, Spanish Football Federation president Luis Rubiales said: “Everyone knew that if Luis Enrique wanted to come back he had the doors open.
“Luis Enrique will continue to the Qatar World Cup [in 2022].”
Enrique was appointed national team boss following Spain’s exit from the 2018 World Cup in the last 16.
He was in charge for the Nations League, where Spain failed to reach the semi-finals, and remained in place for the beginning of their Euro 2020 qualifying campaign.
The Spaniard travelled back home for personal reasons before Spain’s 2-0 victory in Malta in March and Moreno was placed in temporary charge.
Enrique then stepped down three months later.