Luis Enrique is to leave his post as Spain manager and be replaced by Under-21s boss Luis De La Fuente, the country's football federation has announced.
The change comes after Spain's disappointing World Cup last-16 exit on penalties to Morocco on Tuesday.
Enrique's contract had been due to expire at the end of the year and the RFEF issued a statement on Thursday indicating it would not be renewed.
That was then followed by a further statement confirming that De La Fuente had been nominated as his successor and will take up the position from Monday after his appointment is formally ratified.
The first statement read: "The sporting management of the RFEF has handed to the president a report in which it is determined a new project should start for the Spain national team, with the aim of continuing with the growth achieved in recent years thanks to the work of Luis Enrique and his coaches.
"Both the president, Luis Rubiales, and the sports director, Jose Francisco Molina, have transmitted the decision to the coach."
Enrique, who guided Barcelona to Champions League glory in 2015, took charge of his country in 2018, shortly after Spain's exit from that year's World Cup.
He stepped aside for four months in 2019 for personal reasons but returned to oversee a youthful Spanish side's run to the semi-finals of Euro 2020.
Spain also reached a Nations League final under his guidance but Enrique's future had been the subject of speculation for some time, with reports he was considering a return to club football after the World Cup.
Enrique was unwilling to discuss the situation after Tuesday's loss in Qatar but the indicators were it seemed a logical juncture for a parting of the ways.
Spain had begun their World Cup campaign in style with a 7-0 thrashing of Costa Rica but were then held to a draw by Germany and were stunned in their last group game by Japan.
They went out 3-0 on penalties to Morocco after being held to a goalless draw over 120 minutes.
The RFEF went on to pay tribute to the good work done by Enrique during his tenure.
Its statement said the 52-year-old had "given a new impetus to the national team since his arrival" with his focus on youth bringing about a "generational change" and having "sown hope for the future."
It concluded: "The RFEF energetically wishes Luis Enrique and his team the best of luck in their future professional projects."
In confirming his successor shortly afterwards, a second statement added: "The RFEF has chosen Luis De La Fuente as the new national coach."
De La Fuente oversaw Spain's success at the European Under-19 Championship in 2015 and has been Under-21s boss since 2018, winning another Euro crown in 2019.
His first games will be Euro 2024 qualifiers against Norway and Scotland next March.