Egypt and Algeria failed to qualify for the 2018 African Nations Championship (CHAN) finals in Kenya after suffering aggregate defeats to Morocco and Libya respectively.
Morocco beat Egypt 3-1 in Rabat on Friday to win the tie 4-2 overall.
Libya held Algeria to a 1-1 draw in Sfax to go through to the finals with a 3-2 aggregate victory.
The match was played in Tunisia for security reasons.
|African Nations Championship qualifiers - first leg scores in brackets|
|Friday:||Ivory Coast v Niger (1-2)|
|Libya 1-1 Algeria (Libya win 3-2 on aggregate)||Mali v Mauritania (2-2)|
|Morocco 3-1 Egypt (Morocco win 4-2 on aggregate)||Sudan v Ethiopia (1-1)|
|Saturday:||Nigeria v Benin (0-1)|
|Zambia v South Africa (2-2)||Sunday:|
|Rwanda v Uganda (0-3)||Namibia v Comoros (1-2)|
|DR Congo (holders) v Congo (0-0)||Ghana v Burkina Faso (2-2)|
|Cameroon v Sao Tome e Principe (2-0)||Tuesday:|
|Angola v Madagascar (0-0)||Guinea v Senegal (1-3)|
|Aggregate winners qualify for finals in Kenya from 11 January to 2 February|
The Moroccans clinched their place thanks to three second-half goals from Jawad Yamiq, Abderrahim Maqran and Badr Belhrouz.
Hamid Hossam scored a late consolation goal for Egypt, who were making their debut in the biennial competition for home-based footballers.
Algeria knew they had to score at least twice against Libya to survive having lost the first leg 2-1, and they took the lead midway through the first half when Sofiane Bendebka scored off a rebound.
But first-leg match-winner Muaid Ellafi levelled on the stroke of half-time and Libya held on to take the aggregate win.
Despite CHAN matches only featuring locally-based footballers the games have full international status and count toward the monthly Fifa rankings.