The Spanish football federation sensationally sacked head coach Julen Lopetegui on the eve of the World Cup finals on Tuesday, furious that their unbeaten coach had done a deal behind its back to join Real Madrid.

The president of the Spanish FA (RFEF) Luis Rubiales went head to head with Madrid and is understood to have faced down attempts by the club’s players in the national team to save the job of Lopetegui, a former Under-21s manager and friend of Gareth Southgate.

In one of the most extraordinary pre-tournament rows in the history of the World Cup finals, Rubiales, a former head of the Spanish players’ union, cited Madrid’s lack of respect shown to the RFEF. He said he was told of Lopetegui’s decision to join Madrid after the World Cup just five minutes before the club made the announcement on Tuesday.

Rubiales said that he had become aware that while negotiations between Real Madrid president Florentino Pérez and Lopetegui had progressed, senior players were kept in the loop but the RFEF was neither informed by the club nor their erstwhile coach. Speaking about the matter Rubiales said: “Who was contacting them? It’s obvious isn’t it?”

The episode is an embarrassment for Pérez, who put the interests of his own club before the national team and badly misjudged the mood at the RFEF. Lopetegui was immediately replaced by Fernando Hierro, 50, the former Madrid and Spain captain and the RFEF sporting director who takes charge for Friday’s game against Portugal in Sochi.