Morocco defeated 2-1 Canada to top Group F and reach the World Cup knockout stage for the first time in 36 years.
The Atlas Lions, whose previous trip to the last 16 came in 1986, finished above 2018 finalists Croatia, while Belgium – ranked second in the world – are out after finishing third in the group.
A tough test awaits in the next round against the team that finishes second in Group E, which could potentially be Spain or Germany.
Morocco went ahead after just four minutes courtesy of a goalkeeping howler from Milan Borjan.
The Canada keeper sprinted out of his goal but passed the ball straight to Hakim Ziyech, who lofted a cool finish into an open net from 30 yards.
The north African side doubled their advantage through Youssef En-Nesyri’s well-taken goal as he controlled Achraf Hakimi’s superb pass before firing in.
But sloppy defending gave Canada a route back into the game when West Ham’s Nayef Aguerd stuck a boot out to divert the ball into his own net – the 100th goal scored at this World Cup.
Knowing if they avoided defeat they would go through, Morocco were happy to sit back and soak up pressure in the second period.
But Atiba Hutchinson came close with a header that rattled the crossbar and dropped down onto the line as Canada’s campaign ended without a point.
Canada looked vulnerable every time Morocco came forward and more naïve defending contributed to the second goal midway through the first half.
Achraf Hakimi’s long ball from right-back exposed centre-half Kamal Miller and En-Nesyri ran on to it before firing under Borjan, who again should have done better.
Having posed no attacking threat whatsoever, Canada halved the deficit five minutes before the break. Sam Adekugbe skipped past Hakimi down the left and his low cross was diverted goalwards by the toe of Aguerd with Yassine Bounou unable to keep it out at his near post.
En-Nesyri thought he had restored Morocco’s two-goal advantage before the break, firing home after Canada had partially cleared Ziyech’s inswinging free-kick from the right but his effort was ruled out due to Aguerd blocking Borjan’s view from an offside position.
Perhaps sensing the size of their achievement, Morocco went into their shell as the second half progressed.
Alphonso Davies volleyed wide on the stretch before Canada came within inches of an equaliser after 71 minutes, 39-year-old substitute Atiba Hutchinson heading on to the underside of the bar with Alistair Johnston unable to bundle the rebound over the line.
Morocco held on, though, and a goalless draw in the other pool game between Croatia and Belgium sparked wild scenes of celebration at the final whistle.
What does it mean? More African delight
With Senegal and Morocco through, and Cameroon and Ghana still in with a shot, there could be a healthy African contingent in the knockout phase.
No-one will be taking Regragui’s side lightly. Strong in midfield with Sofyan Amrabat a particularly imposing presence, and possessing a sprinkling of quality in attack courtesy of Ziyech and En-Nesyri, they will be tough opponents.