Spain coach Julen Lopetegui has been fired two days before the country's opening World Cup match against Portugal and a day after accepting the job to coach Real Madrid next season.
Former Spain defender Fernando Hierro has been announced as Lopetegui's replacement.
Hierro's only previous senior coaching role was one season with Oviedo in the Spanish second division, although he was also assistant to Carlo Ancelotti at Real Madrid before that.
The 50-year-old will have barely 48 hours to prepare his team for their opening World Cup match against neighbours and bitter rivals Portugal in Sochi on Friday.
Spanish soccer federation president Luis Rubiales said firing Lopetegui was not the best solution for the national team but it was needed after being caught by surprise by Real Madrid's announcement.
"The federation cannot be left out of a negotiation by one of its workers and be informed five minutes before the press release," Rubiales said.
"We have been compelled to act."
Rubiales, who took over as president last month, said the federation's values were broken and it was the only decision he could make.
"It's a difficult situation, but we are not the ones who determined the action that had to be taken," he said.
"It may look like a weakness now, but with time this will make us stronger."
Lopetegui did not attend the news conference in Krasnodar.
"We have to work on a series of decisions that come just two days before the opener," Rubiales said.
"There's a lot to do."