Cairo: Defending champions Cameroon slipped up on the last day of the group stage at the Africa Cup of Nations on Tuesday and their 0-0 draw with outsiders Benin set up a challenging last-16 match against Nigeria.

Cameroon lost top spot in Group F to Ghana, who overcame an unimpressive start to the tournament to beat Guinea-Bissau 2-0 when it really counted. Ghana’s first win in Egypt came via second-half goals by Jordan Ayew and Thomas Partey and put the Black Stars back on track.

The last 16 line-up has now been decided and the most compelling matchups alongside Cameroon v Nigeria are: Hosts Egypt and Mohammad Salah v South Africa, Sadio Mane’s Senegal v Uganda, and Ghana v Tunisia. Surprise package Madagascar, playing at their first African Cup, must beat Congo to take their strong run into the quarter-finals.

Ghana, four-time champions, were under threat of not qualifying at all. But Jordan Ayew’s splendid solo goal a minute after half-time against Guinea-Bissau in Suez settled the nerves and Thomas Partey poked in a cross from close range in the 72nd to make sure of progression. Ayew broke down the left wing, skipped past a defender and curled a right-foot shot high into the far corner of the goal.

Ghana won the group ahead of Cameroon on goals scored after both finished with a win and two draws.

Tuesday’s victory was the first real piece of good news at the tournament for Ghana, who started with two draws and this week learned they had lost influential winger Christian Atsu for the rest of the tournament with a hamstring injury.

Clarence Seedorf’s Cameroon made life difficult for itself by missing out on first place in the group. Benin’s reward for the draw with the title holder in Ismailia was a place in the knockouts at the African Cup for the first time.

Benin squeezed in as one of the four best third-place teams.

Mali won Group E, the last group to be wrapped up, with a 1-0 win over Angola. The 21-year-old midfielder Amadou Haidara scored late in the first half with a powerful left-foot shot that swerved into the top corner and gave Angolan goalkeeper Tony Cabaca no chance.

Striker Moussa Marega should have made it comfortable for Mali when he chested a corner down in the 90th minute but sliced his shot wide.

Tunisia were the last team to go through after drawing 0-0 with Mauritania, another team making their African Cup debut.