MOSCOW (AP) — As completely and utterly crazy as it looks for Spain to cut off its own head on the eve of the World Cup, there is a logical explanation for the out-of-the-blue, "Are you frigging kidding me?" decision to sack Julen Lopetegui as coach just two days before he was to lead the Spanish team against Portugal.

Simply put: A leader can't lead effectively if he is beholden to two masters at once.

Accepting a job from Real Madrid to replace departed coach Zinedine Zidane, when his country expected him to focus 100 percent on winning the World Cup with a Spain team talented enough to lift the trophy, made Lopetegui the architect of his own downfall.

Securing his post-World Cup future before Spain had kicked a ball in Russia suggested, at the very least, that Lopetegui's mind wasn't fully zeroed-in on the weeks ahead and on the job Spain paid him for: To ensure that the 2010 World Cup winners do not crash out in humiliation after just three games, as they did in 2014 .

At worse, saying "Si" to Madrid so quickly, instead of saying, "I'm terribly busy, get back to me in a few weeks?" suggested that Lopetegui's heart wasn't fully devoted to Spain, either.

"The federation cannot be left out of a negotiation by one of its workers and be informed five minutes before the press release," Spanish soccer federation president Luis Rubiales said. "We have been compelled to act."

Maybe Madrid made Lopetegui a take-it or leave-it offer. Perhaps he tried and failed to persuade the club to postpone news of his hiring until after the World Cup. Either way, Madrid's announcement had the ultimate effect of making Lopetegui look selfish, as though he cared more about himself and his next step on the career ladder than his country's immediate future. How, in the wake of that, were his players expected to remain loyal to him when his loyalties were visibly shifting elsewhere?

Being the coach-in-waiting of Madrid while also coaching Spain was, in football terms, also like Mick Jagger telling another band that he'd be happy to leave Keith Richards and join them while just about to embark on a long-planned tour with the Rolling Stones. Having a stake in Spain and in Madrid left Lopetegui vulnerable to potentially explosive conflicts of interest.

Six members of the 23-man Spain squad play their club football for Real Madrid. So just imagine the questions and doubts that Lopetegui might have faced if and when he fielded them in Russia. Did he pick Player X on merit alone? Or was it to curry favor with a member of the team upon whom his fortunes as coach will depend in a few weeks?

Barcelona, Madrid's fiercest rival, supplied four members of the Spain team. Again, Lopetegui's handling of them in Russia would have been seen through the prism of his next job. Did he bench Player Y because he didn't deserve to start or, again, because Lopetegui was already playing Madrid vs. Barcelona chess? As for Spain's players from other clubs, there could have been questions about whether Lopetegui was wooing them to join him in Madrid.

And how about this for a nutty conspiracy theory: Did Madrid drop the bombshell of Lopetegui's hiring now to deliberately throw Spain into disarray? By weakening the national side, did Madrid hope to give a helping hand to Cristiano Ronaldo, the club's most valuable asset and captain of Portugal, Spain's most threatening opponent in Group B?

And if Madrid players on the Spain team go easy with club buddy Ronaldo in Sochi's stadium on Friday night, might it be because they don't want to upset their boss-to-be?

Outrageous, right? All completely unfounded and almost treasonous suggestions. But the sort of dangerous fuzzy thinking that can take root when loyalties and priorities are unclear.

If Spain recovers quickly from the shock of Lopetegui's firing, the federation president will be able to argue that he was wise to make a clean break, before play begins, rather than after a few games, when a mid-World Cup firing might have been more destabilizing.

Then again, it leaves replacement coach Fernando Hierro in an unenviable position.

If the former national team player and Real Madrid captain fails to steady the ship and Spain again takes an early flight home, all that anyone will ever remember of its 2018 World Cup will be: LOL, crazy.

___

John Leicester is an international sports columnist for The Associated Press. Write to him at jleicester@ap.org or follow him at http://twitter.com/johnleicester

___

More AP World Cup coverage: www.apnews.com/tag/WorldCup

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.