Morocco topped Group F after a 2-1 win against Canada in the FIFA World Cup on Thursday.
Collecting seven points, Morocco advanced to the knockout stage for the first time since 1986.
The Atlas Lions become the first African team to top a world cup group since 1998.
Morocco found an early goal when Hakim Ziyech made a long-range finish in the fourth minute at Doha’s Al Thumama Stadium.
Youssef En Nesyri doubled the lead with his right-footed goal from the penalty area in the 23rd minute.
In the 40th minute, Canada narrowed the gap to one with an own goal from Nayef Aguerd.
After five minutes, En Nesyri scored again for his national team but it was disallowed for a tight offside call.
Neither of the teams was able to produce a goal in the second half as the game ended with a 2-1 score in favor of the Atlas Lions.
Croatia, who also qualified for the next stage, are second with five points and Belgium are in the third spot with four points.
Canada finished bottom of the group without a point.