The Spanish Football Federation on Wednesday announced it sacked its World Cup manager Julen Lopetegui just days before the team's first match against Portugal.

In a decision that makes Japan's move to fire Vahid Halilhodzic two months ago look like a fine piece of pre-planning, Spain removed Lopetegui after Real Madrid announced Tuesday he would fill their manager role recently vacated by Zinedine Zidane.

(Luis Rubiales announces Spain's decision to dismiss coach Julen Lopetegui.)

"We've been obliged to dismiss Julen Lopetegui because there are decisions that have to be taken due (to) certain behaviors and values," Federation President Luis Rubiales said in a statement.

Rubiales apparently "understands the negotiation on behalf of Julen has been 'legitimate' but 'manners are important' and he does not agree with the way things were done," the statement on the federation website read.

According to media reports, the recently installed Rubiales was unhappy Lopetegui had agreed to the new role without informing the federation. Rubiales was reportedly only made aware of the impending announcement five minutes before it went public.

Fernando Hierro was announced as his replacement for the World Cup in Russia, which starts Thursday.

Under Lopetegui, Spain had an unbeaten record with 14 wins and six draws since he took the helm on July 21, 2016. He also managed the country's under 19, 20 and 21 teams between 2010 and 2014.

Rubiales said the players "will do everything within their reach to achieve the best results of the World Cup...Now we have to go work together."

Spain plays fellow European powerhouse Portugal on Friday in Sochi before taking on Iran and Morocco in their final two Group B games.

Asked for a reaction at a press conference at Moscow's Luzhniki Stadium on Wednesday, Saudi Arabia's Argentinean coach Juan Antonio Pizzi said he felt for all involved.

"I've been very close to Julen also Fernando Hierro, the newly appointed coach. I don't know the details, but seeing what has happened I wish all the best to Fernando and his staff and I really hope they can overcome what has happened over the past days and do so in the best possible manner."