The 2015 winners join Emmanuel Adebayor's Togo in exiting early
Reigning Africa Cup of Nations champions Ivory Coast have been knocked out of the 2017 tournament at the group stage.
Two years on from their dramatic penalty shootout win over Ghana in 2015, the Elephants were defeated 1-0 by Morocco to end the tournament without a win.
They had come into the final game of their 2017 Nations Cup with two draws and needing a win to progress.
But a long range shot from Morocco's Rachid Alioui knocked out Ivory Coast and in turn put the Atlas Lions through to a quarter final match against the winner of Group D which will be either Ghana or Egypt, depending on the outcome of those teams' head to head fixture on Wednesday.
DR Congo however top Ivory Coast and Morocco's Group C as they saw off bottom side Togo 3-1.
Only needing a draw to progress, DR Congo took a 2-0 lead through Junior Kabananga and Ndombe Mubele .
Kodjo Fo-Doh Laba pulled one back for Togo but a Paul-Jose M'Poku free kick secured a 3-1 win for DR Congo and sent Emmanuel Adebayor and Togo home with just one point from their three games in Gabon.
DR Congo will face the runner up of Group D in their quarter final match.