Youssef En-Nesyri scored the only goal as Morocco beat Ivory Coast 1-0 to qualify for the knockout stages at the Africa Cup of Nations.
En-Nesyri scored after 23 minutes as Herve Renard's side made it successive 1-0 victories in Group D, following their success against Namibia in the opening match.
Romain Saiss made a superb goal-line clearance to deny Jonathan Kodjia in the opening minute before En-Nesyri brilliantly evaded a series of challenges and scored with a low finish.
Max Gradel and Nicolas Pepe worked the Morocco goalkeeper while Kodjia, who scored his side's winning goal against South Africa, was off target this time.
En-Nesyri went close to a second goal with a header and Noussair Mazraoui also could have made it 2-0 late on but his volley crashed against the crossbar from close range.
Morocco advance while Ivory Coast's fate will be decided in their final group game against Namibia.