Morocco beat Namibia 2-0 in Casablanca after goals from Ayoub El Kaabi and Salaheddine Saidi to reach their first CHAN semi final.
The Atlas Lions controlled the contest throughout against their more limited opponents, but needed a quickly taken free kick to break the deadlock in the 35th minute after Namibian resolve had held firm during the opening half an hour.
Saidi added a header in the 54th minute after meeting Achraf Bencharki's corner while Namibia appeared to have a legitimate late goal chalked off by the referee.
Morocco can now look forward to a semi final back in Casablanca against either Congo-Brazzaville or Libya who meet in Agadir on Sunday to contest the fourth quarter final.
Sudan caused something of an upset with a 1-0 win over Zambia in the quarter-finals of the African Nations Championship (CHAN).
Zambia started the game in Marrakech promisingly with some early chances for Augustine Mulenga and Kondwani Mtonga,
Sudan took the lead just after the half-hour mark as Maki Bakhit Saifeldin turned debutant John Mwengani to score the only goal of the game.
Sudan will play the winner of Nigeria and Angola who play in their quarter-final.
#Zambia had been tipped as one of the favourites for the title in Morocco, but Maki Bakhit Saifeldin scored the only goal of the game as Sudan reached their first CHAN semi-final since 2011, when they hosted the tournament. pic.twitter.com/2nDllzw5RN— Oluwashina Okeleji (@oluwashina) January 28, 2018