The Spanish soccer federation has fired coach Julen Lopetegui two days before the country's opening World Cup match against Portugal.
Lopetegui was let go a day after Real Madrid announced him as its new coach following the World Cup.
Federation president Luis Rubiales says it wasn't the best solution for the national team but the action was needed after it was caught by surprise by Real Madrid's announcement.
A replacement was not immediately announced.
Earlier on Tuesday, Real Madrid said Lopetegui will take over as manager after the World Cup. Madrid said in a short statement that Lopetegui has agreed to coach the Champions League winners for the next three seasons once Spain's participation in soccer's biggest event is over.
The Spanish football federation said Madrid had paid an undisclosed amount to trigger the buyout clause included in Lopetegui's contract.
"The Spanish football federation asks for the maximum respect in order to maintain a sense of normalcy around the national team as it is about to debut in the World Cup," the federation said in a statement.
Lopetegui will take the place of Zinedine Zidane, after he surprised the club two weeks ago by saying he was leaving after winning an unprecedented three straight Champions League titles.
Lopetegui was Vicente del Bosque successor for Spain following the team's failure to successfully defend its title at the 2016 European Championship.
The 51-year-old Lopetegui is credited with reviving a Spain team that was on the decline in the last years under Del Bosque after it won the 2010 World Cup and two straight Euros. He has kept Spain unbeaten through 20 matches in charge and guided it to a first-place finish in a qualifying group that included Italy for the 2018 World Cup.
Part of his success was blending in younger talents like Francisco "Isco" Alarcon, Marco Asensio and Rodrigo Moreno into a squad led by veterans Andres Iniesta, Sergio Ramos and David Silva.
Lopetegui will soon coach Ramos, Isco, Asensio and fellow Spanish internationals Dani Carvajal, Nacho Fernandez and Lucas Vazquez at Madrid's Santiago Bernabeu stadium.
The immediate reaction on Spanish sports talk radio was to criticize the timing of the announcement given the possible distraction it could cause on Spain's team before a tournament it has spent two years working towards.
Lopetegui was picked as Del Bosque's replacement mostly because of his success with Spain's youth squads. He won European championships with the under-19 and under-21 teams in the early 2010s.
While shining with Spain's national sides, he had a lackluster stint with Portuguese club Porto in his only stint at a major club. He was fired after failing to win a title during almost two years in Portugal.
A former goalkeeper who started a handful of games in goal for Real Madrid and Barcelona, Lopetegui played for Spain in the 1994 World Cup.