MADRID — Real Madrid finally pulled the trigger and fired coach Julen Lopetegui on Monday.

The not-surprising announcement followed a meeting by the club's board of directors, a day after the team was 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. The 52-year-old coach, making his debut with a major club in a top European league, was let go from Spain's national team just before the World Cup for not telling federation officials he accepted the Madrid job.

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

The board of directors believed there was a huge difference between the quality of the squad and the results it was achieving. The team has lost five of its last seven matches. The board noted the team has eight players nominated for the Ballon d'Or award, something unprecedented in the club's history.

Lopetegui, who led the team practice on Monday morning, was hired by Madrid to replace Zinedine Zidane, who quit after leading the club to the last three Champions League titles.

Madrid is ninth in the Spanish league, seven points behind leader Barcelona after 10 matches.

Solari, aged 42, is a former Argentina midfielder who played for Real Madrid in the early 2000s and helped the team win the 2002 Champions League. He also played for Atletico Madrid and Inter Milan.

He had been coaching Real Madrid B since 2016, taking over not long after Zidane left to coach the main squad.

Less than three months into the season, Lopetegui is the second La Liga coach to be fired. The first was Leo Franco of promoted club Huesca, currently last in the 20-team standings.