Achraf Bencharki missed a second-half penalty as Morocco were held 0-0 by Sudan in their final group game at the African Nations Championship in Casablanca on Sunday.
The point is enough for Morocco to top the group - setting up a meeting with either Zambia or Namibia at the Stade Muhammed V on Saturday - while Sudan will face Group B's winner on the same day in Marrakech.
In the group's other fixture, already eliminated Guinea beat Mauritania 1-0 to end their disappointing campaign with a first win of the tournament.
In Casablanca, Jamal Sellami opted for a much changed XI for Morocco's final group game, with centre-back Nayef Aguerd the only survivor from their first two fixtures.
The introduction - from the off - of Wydad Casablanca duo Bencharki and Walid El Karti ensured, however, that the Atlas Lions lost none of their attacking venom during the early stages.
Ahmed Hammoudan set the tone with a dangerous cross during the early moments, while Bencharki - the darling of the Casablanca crowd - broke through in the first moment only to chip his effort over the bar.
Sudan soon got the measure of this unfamiliar Morocco selection and stymied their attacking threat, although Aguerd did sent a header over the bar from seven yards after being picked out, unmarked, by a ocorner in the 37th minute.
Morocco began the second half as they had the first, and catching Sudan cold they earned a penalty moments after the restart when Bakri Bachir Bakri brought down El Karti.
Referee Jean-Jacques Ngambo pointed to the spot, but Sudan goalkeeper Akram was equal to Bencharki's effort to preserve the stalemate.
As the game became increasingly tetchy, Sellami introduced Zakaria Hadraf and tournament top scorer Ayoub El Kaabi in a bid to preserve his side's 100 percent record.
While the latter went close with a side-footed effort from inside the box three minutes from time, the Falcons of Jediane stood firm to survive a testing examination of their own title credentials.
In the other Group A clash, Ibrahima Sory Sankhon struck in the 15th minute as Guinea beat Mauritania 1-0 to end their disappointing campaign with a win.
Guinea held their own for long spells against an experienced Sudan team and Morocco, but ultimately ended both contests pointless to drop out of contention before this final dead rubber.