Halilhodžič led Morocco from August 2019, but was dismissed three months before the championship due to disagreements with star striker Hakim Zijach. In his place, Valíd Rajrajúi took charge of the team.
Under his leadership, Morocco progressed from first place in the group to the round of 16, where they knocked out Spain and then also dealt with Portugal in the quarter-finals. France was beyond his strength in the semi-finals and then Croatia in the bronze medal match.