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 emerged runners-up from Group E in the last 16.
Canada’s defeat meanwhile capped a disappointing World Cup for the CONCACAF side, who depart after losing all three of their group games on their long-awaited return to the finals.
Morocco put themselves firmly on course for the second round after upsetting Belgium 2-0 on Sunday, a result that left them needing only a point against Canada on Thursday to be sure of advancing.
Achieving that objective never looked in doubt after the Moroccans grabbed the lead after only four minutes in front of 43,102 fans at the Al-Thumama Stadium.
In the other Group F match, Romelu Lukaku missed a string of late chances as Belgium crashed out of the World Cup in the group stage after a 0-0 draw with Croatia which sent the 2018 runners-up into the knockout phase.
Croatia had a penalty award controversially cancelled by VAR early in a largely uneventful first half.
The introduction of Lukaku at the interval changed the game, but he was guilty of three dreadful misses as Zlatko Dalic’s side rode their luck to hold on.
Meanwhile, giant-killers Japan caused another upset after they defeated tournament favourites Spain 2-1 to top Group F with six points and a Round of 16 clash with 2018 Runners up Croatia.
It was, however, a bad day in the office for former champions Germany who thrashed Costa Rica 4-2 but crashed out due to inferior goal difference.
The Germans ended with four points, the same as Spain but the 2018 champions booked their Round of 16 clash with Morocco on superior goal difference of +6.