Lopetegui has been sacked for accepting the Real Madrid job before informing the Spanish Federation.
French coach Zinedine Zidane quit his role as coach of Real Madrid boss after an unprecedented third consecutive Champions League triumph to leave a vacant hole in the Santiago Bernabeu dugout.
Lopetegui reportedly was in touch with Real Madrid during negotiations to get the job, without proper information to the Royal Spanish Football Federation (RFEF).
A statement by the Luis Rubiales president of the RFEF revealed that Lopetegui has been sacked.
He said, "We have decided to fire the national coach.
"What we have achieved in getting here is due in great part to him, and we must thank him and wish him luck."
The Spanish team face neighbours Portugal in their World Cup group game and Rubiales stated that the team is focused on the encounter rather than the outgoing coach.
He said, "All this is a big blow, but we are training again later today, we will stay together and move forward," he said.
"The players are very focused and they have told me they are fully committed and will give 100 per cent."
Fernando Hierro has been appointed as the man to lead Spain at the 2018 FIFA World Cup following the sack of Lopetegui.
Hierro was the sporting director for the Spanish team and was eased into the role following the sack of Lopetegui.
Hierro has experience as an assistant coach at Real Madrid and Real Oviedo and has also worked as a director of football at Malaga.
He now faces a tough challenge of getting the 2010 FIFA World Cup champions ready for a derby against Cristiano Ronaldo's Portugal in their opening group B fixture scheduled for Friday, June 15.