Morocco powered into the last 16 of the World Cup for the first time in 36 years on Thursday with a 2-1 victory over eliminated Canada.
Goals from Hakim Ziyech and Youssef En-Nesyri ensured the North Africans finished top of Group F ahead of 2018 World Cup runners-up Croatia.
Morocco, who last reached the knockout stages of the World Cup in 1986, will face Spain who finished as runners-up from Group E in the last 16, after the 2010 winners suffered a shock 2-1 loss to Japan on Thursday.
Japan, who finished top of Group E, will take on Croatia for a place in the quarter-finals.
Meanwhile, despite beating Costa Rica 4-2, Germany are out of the 2022 World Cup having finished third in Group E.