Hosts Ivory Coast have made it as one of the best third-placed teams heading into the Round of 16 of the 2023 Africa Cup of Nations (AFCON).
Morocco defeated Zambia 1-0, and DR Congo held Tanzania to a goalless draw on Wednesday night.
Ivory Coast will now play Senegal in the Round of 16.
Hakim Ziyech found the net to give Morocco a 1-0 Group F win over Zambia on Wednesday, a result that enabled hosts Ivory Coast to sail into the last 16.
The Ivorians, who were defeated 4-0 by Equatorial Guinea on Monday, were among the four highest-ranked third-place teams to qualify.
Group winners Morocco will face South Africa in the round of 16, while the runner-up Democratic Republic of the Congo, which drew 0-0 with Tanzania, will play Egypt.
Morocco coach Walid Regragui watched the game from the stands after being suspended for two games following a post-match altercation with DR Congo captain Chancel Mbemba on Sunday.
Morocco was playing their 73rd match and Zambia their 70th in the flagship African championship, but this was only the third meeting between the two, with the Atlas Lions winning and drawing the first two.
The shock 2022 World Cup semi-finalists rested captain and defender Romain Saiss, while forward Youssef En-Nesyri began on the bench.
With Zambia captain Roderick Kabwe suspended, Chipolopolo (the Copper Bullets) were headed by recalled Lubambo Musonda, with regular starters Fashion Sakala and Kings Kangwa as substitutes.
Morocco began the final round group match already assured of a last-16 place, while Zambia had to at least draw to squeeze through at the expense of Ivory Coast.