Spain sacked coach Luis Enrique on Thursday after the 2010 champions were dumped out of the World Cup by Morocco at the last-16 stage, quickly naming his replacement as under-21s boss Luis de la Fuente.
Spain started their campaign in Qatar in style by hammering Costa Rica 7-0 and qualified for the knockout phase despite a shock 2-1 defeat to Japan.
They were strong favourites for their last-16 match against Morocco but crashed out on penalties after the game finished goalless following extra-time.
"Both the president, Luis Rubiales, and the sporting director, Jose Francisco Molina, have told the coach their decision," the RFEF (football association) said in a statement.
They said they wanted to thank Luis Enrique and his staff for their work, but had decided to start a "new project".
Shortly afterwards, the federation announced that De la Fuente, who led Spain's men's team to the silver medal at last year's Olympics, was the new man in the hotseat.
Luis Enrique had said he wanted to stay on as coach after the defeat by Morocco on Tuesday.
"I am very happy with the Spanish FA, the president and with (the sporting director)," he said.
"If it was up to me I would stay all my life, but that is not the case. I have to think calmly what is the best for me and for the national team."
Spain last lifted a major trophy a decade ago at Euro 2012, while they have not won a single knockout game at the Word Cup since triumphing in South Africa in 2010.
Luis Enrique took over in 2018 after Spain's disappointing showing at the World Cup in Russia, and led La Roja to the semifinals of Euro 2020, where they were also beaten on penalties, by Italy.
His time as Spain coach was characterised by a firm commitment to maintaining possession.
They attempted more than 1 000 passes against Morocco but ended up with nothing to show for it, forcing Yassine Bounou into only one save before the shootout.
"We dominated the game but we lacked a goal," lamented Luis Enrique. "We could have been more effective in the final third, but I am more than satisfied with what my players did.
"They represented perfectly what my idea of football is."
The RFEF announced De la Fuente as Luis Enrique's replacement and his appointment will be ratified next week by the federation's board of directors.
"The new coach will make his debut in March for Euro 2024 qualifiers, taking charge of his first games against Norway and Scotland," said the RFEF in a statement.
De la Fuente will be officially presented on Monday as the coach.
The 61-year-old is a coach who also likes his team to keep hold of the ball, but is more flexible than his predecessor and willing to try other strategies when necessary.
Many of the young players in the Spain World Cup squad previously played for De la Fuente at youth level.
Last year De la Fuente coached the Spain national team in a friendly against Lithuania, using U21 players, as the first team squad and staff were forced to quarantine after one positive Covid case, as protocol demanded at the time.
Catch the 2022 FIFA World Cup on SuperSport in 13 languages. Press "Options" on your remote for languages available in your region.