Rachid Alioui scored with a terrific shot from 25 yards to earn the win for Morocco and their coach Herve Renard, who led the Ivorians to the 2015 title.
Ivory Coast needed a win to go through but gave a listless performance, creating only two chances of note.
Wilfried Zaha shot weakly from 12 yards, while Salomon Kalou’s header from a tight angle clipped a post.
The Elephants lacked urgency in their play and go home after appearing not to put up a fight.
Even after going behind they were unable to cause the organised and disciplined Morocco defence any problems.
Morocco went into the game knowing that a draw was very likely to be enough for them to qualify from Group C and their game plan from the start was to stay compact and hit on the counter-attack.
Click The Link for more information on Morocco Knock Out The Champions Ivory Coast 1-0 To Reach The Africa Cup of Nations 2017 Quarter-Finals