Madrid: Real Madrid sacked their coach Julen Lopetegui on Monday, less than five months after he was fired by Spain before the 2018 World Cup in Russia for not telling federation officials that he accepted the Madrid job.

The dismissal followed a meeting by the club's board of directors on Monday, a day after Real were crushed by Barcelona 5-1 at Camp Nou Stadium.

Santiago Solari, coach of Real Madrid B, will take charge for the Copa del Rey match against third-division club Melilla on Wednesday.

Spanish media speculated Solari, a former Madrid player, was in the running for the permanent job along with former Chelsea manager Antonio Conte and Belgium manager Roberto Martinez.

The firing caps a horrible few months for Lopetegui and is likely to deal a significant setback to his career. After doing well with Spain's youth teams, he had a lackluster stint with Portuguese club Porto, but gained prominence after revamping Spain and turning it into a contender entering the World Cup.

"I want to thank the club for the opportunity it gave me and the players for their effort," Lopetegui told the local news agency EFE. "I wish the team the best for the rest of the season."

Madrid said in a statement it sacked 52-year-old Lopetegui to "change the team's dynamic while all of its objectives for the season were still reachable."

In 14 matches with Lopetegui, Madrid won six, lost six, and drew two.

Meanwhile, Portuguese superstar Cristiano Ronaldo has blamed Real Madrid president Florentino Perez for his exit from the club.

"I felt it inside the club, especially from the president, that they no longer considered me the same way that they did in the start," he said in an interview with French Football magazine. 

"In the first four or five years there I had the feeling of being ‘Cristiano Ronaldo’. Less afterwards. The president looked at me through eyes that didn’t want to say the same thing, as if I was no longer indispensable to them, if you know what I mean," Ronaldo, who moved to Juventus, added.

"That’s what made me think about leaving. Sometimes I’d look at the news, where they were saying I was asking to leave. There was a bit of that but the truth is I always had the impression the president would not hold me back," he said.

Ronaldo's comments led to even India cricketer Rohit Sharma questioning Perez as he tweeted, "What did you do Mr Perez".

With inputs from AP