The players urged Rubiales to “swallow his pride” and let Lopetegui remain as coach, to avoid disrupting the team’s preparations, according to reports.

Rubiales, however, was unmoved. At noon in Krasnodar, he appeared in front of journalists and announced that Lopetegui had been dismissed. He insisted that he did not feel “betrayed” by the coach, but said the talks had not been handled professionally.

“The federation cannot be kept outside the negotiations for one of its employees,” he said. “You cannot do things like that, just five minutes before the announcement is made.”

He did not blame Lopetegui for the turmoil, describing him as a “very good coach, a man of professional integrity who has done an excellent job,” and was not drawn into a discussion about Real Madrid’s conduct: One Spanish sports newspaper on Wednesday morning described the timing of the announcement as a “missile” to the national team.

Real Madrid — winner of Europe’s most prestigious club competition, the Champions League, for the last three years — will pay the Spanish soccer federation 2 million euros, or about $2.35 million, in compensation.

“I know there will be criticism, whatever I do,” Rubiales said. “It is a very difficult situation. The Spain team is the team of all Spaniards. You cannot do things this way, two or three days before the World Cup. We have been obliged to make this decision.”

Lopetegui — who did not lose any of the 20 games he oversaw as Spanish coach, and won 14 of them — has spent time as both a player and a coach at Real Madrid, first as a goalkeeper and later in charge of Castilla, its B team.