Morocco beat Ivory Coast 1-0 to qualify for the last 16 from the African Cup of Nations' so-called group of death, giving coach Herve Renard another victory over his former team on Friday.

Youssef En-Nesyri slotted home for the only goal in the first half having been set up by a defence-splitting pass by Nordin Amrabat.

Morocco is the first team through from Group D, which contains three former champions in Morocco, Ivory Coast and South Africa, hence its group of death tag.

Morocco joined host Egypt, Nigeria and Algeria as the teams to have qualified so far for the last 16.

Renard's Morocco beat and eliminated Ivory Coast at the 2017 African Cup. Renard coached Ivory Coast to the 2015 title before moving on to Morocco and the Frenchman is seeking a third title with a third different team having also won with Zambia in 2012.

Morocco probably should have won by two or three goals on the balance of play at Al Salam Stadium in Cairo.

One was enough. Amrabat weaved infield from the left wing leaving defenders in his wake before timing a pass perfectly to put En-Nesyri clear for the goal.

South Africa beat Namibia 1-0 to go level with Ivory Coast on three points.

Bongani Zungu finally broke through for South Africa with a header from a corner in the 68th minute and Namibia still hasn't won a game at the Cup of Nations in eight attempts, although it put up a brave fight against the South Africans.

Namibia came close to taking the lead three minutes before Zungu's goal, when Deon Hotto had a shot cleared off the line after goalkeeper Darren Keet spilled a cross.

Ivory Coast has the edge in the battle for second place in the group as it plays Namibia in the last round of games while South Africa faces Renard's Morocco.

In Group E, Wahbi Khazri's deflected free kick in the 70th minute and rescued a 1-1 draw for Tunisia against Mali and kept that group tight.

Khazri was aiming for the top right corner of the goal when the ball deflected off the defensive wall and looped into the bottom left corner, leaving Mali goalkeeper Djigui Diarra helpless.

Mali led after a bad error from Tunisia goalkeeper Hassan Mouez, who came out to catch a corner and let the ball slip through his hands and into the goal.

Mali, with a win and a draw, leads Tunisia, which has two draws, by two points in the standings. The other teams in that group are Mauritania and Angola.

___

More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports