Ivory Coast finished level on points with Rwanda but lost out on top spot on head-to-head record
Ivory Coast thrashed Gabon 4-1 on Sunday in Rwanda to book their place in the CHAN quarter-finals.
Morocco beat Rwanda by the same scoreline in the other Group A match but it wasn't enough for the Atlas Lions as the hosts had already secured their place in the last eight.
Ivory Coast finished level on points with Rwanda but lost out on top spot on head-to-head record.
Gabon finished bottom with only a single point.
Defender Essis Aka atoned for an early booking to put the Elephants ahead after 19 minute with a spectacular long range strike.
Franck Obambou levelled for the Gabonese in the 51st minute but goals from Djeje Guiza, Koffi Boua and Ble Nilmar Treika put the result beyond doubt.
Morocco scored all four goals in the first half, with a brace coming from Aziz Mouaoui in the 15th and 30th minutes.
Hegman Ngomirakiza pulled one back for the Amavubi Wasps, who were otherwise totally outplayed.
Group B will be decided on Monday at the Stade de Huye in Butare, where Cameroon meet DR Congo and Angola face Ethiopia.
With the 2009 champions DR Congo having sealed their place, Cameroon and Ethiopia will be fighting to take second spot.