SOCHI, Russia (AP) — Compared to Spain's coaching chaos, the distractions created by Cristiano Ronaldo have become almost meaningless for Portugal.

Spain will play its opening World Cup match against the European champions on Friday with a coach who has been on the job for only two days. Fernando Hierro, a former national team player who had been acting as the national team's sports director in Russia, will coach the squad following the Spanish federation's shocking decision to fire Julen Lopetegui on Wednesday.

"We have to stop thinking about the past and focus on our match against Portugal," Hierro said Wednesday. "We don't have time to lament. We have to be mature. We have to change our focus. We have an obligation to do it."

Portugal had been the team dealing with off-the-field distractions ever since Ronaldo hinted after the Champions League final that he was going to leave Madrid. He said he would reveal his plans when he joined the national team, putting the spotlight on himself instead of Portugal's World Cup preparations, but he was yet to make any announcements.

"We are in a very difficult situation," Spanish federation president Luis Rubiales said. "It's very complicated. I'm not going to come here and say that this was the best solution."

Spanish football president Luis Rubiales discusses firing Lopetegui

Everything appeared to be running smoothly for Spain, with Lopetegui leading the team on a 20-match unbeaten streak and turning it into a top title contender again after disappointing eliminations from the 2014 World Cup and the 2016 European Championship.

But Rubiales, the newly elected federation president, didn't like the timing of Madrid's surprise announcement on Tuesday and decided to take the drastic measure of firing the coach. He said that winning was important but not as much as maintaining the federation's values.

"I talked to the players and they have shown their commitment to do everything they can to take the national team as far as possible in this tournament," Rubiales said. "This is already in the past. We are moving forward."

Hierro, a former national team player and Real Madrid captain, is taking on his first major coaching job. He was Carlo Ancelotti's assistant at Madrid after Zinedine Zidane left the post in 2014, and coached second-division club Real Oviedo two seasons ago.

"I only have one year of experience with Oviedo and one year of experience as an assistant coach," Hierro said. "(But) I've been near a ball for 30 years."

Fernando Hierro, second right, attends the news conference where federation president Luis Rubiales announced the firing of coach Julen Lopetegui

FAVORITE VS. CANDIDATE

Portugal coach Fernando Santos wants Portugal to keep the same low-key mentality that worked well for the team at Euro 2016.

Santos said Portugal can be considered a "candidate" for the title in Russia but it still shouldn't be included among the top contenders despite being European champions.

He said the opener will be the game between the "favorite and the candidate."

Nine of the players who started in the Euro 2016 final against France are back for the World Cup, with the only absences being veteran forward Nani and young midfielder Renato Sanches. In total, 13 players from the Euro 2016 squad are in Russia.

LONG RIVALRY

The rivalry between Spain and Portugal goes way back to when the Iberian neighbors fought each other for world domination more than 500 years ago.

But their soccer rivalry isn't as fierce, and this will be only the second time the neighbors meet in soccer biggest event, with Spain holding the advantage of a 1-0 win in the round of 16 at the 2010 World Cup.

The teams met in the semifinals of Euro 2012, with Spain advancing on penalties, but Portugal got the best of its rival in the group stage of Euro 2004, winning 1-0. The only other time they met in a major competition was at Euro 1984, when the teams drew 1-1 in the group stage.

___

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

___

Tales Azzoni on Twitter: http://twitter.com/tazzoni