Algeria are through to the last eight of the African Cup of Nations as Group C runners-up, after a convincing 2-0 victory over Senegal in their final group match in Malabo.
The Lions of Teranga came into the match needing just a draw to progress to the quarter-finals, but were undone by goals from Premier League stars Riyad Mahrez of Leicester City and Tottenham's Nabil Bentaleb.
Senegal could still have gone through had South Africa gained a point against Ghana in the group's other match, but the Black Stars came from behind to beat Bafana Bafana 2-1 in Mongomo.
Alain Giresse's side played a physical game in the second half as they looked to come back from Mahrez's 11th minute goal, but were undone on the break as Bentaleb curled a left-footed effort past Bouna Coundoul to wrap up the victory in the 81st minute.
3' CHANCE! Papy Djilobodji miscontrols 25 yards from goal but Sofiane Fehouli fails to beat Bruno Coundoul on the one-on-one. What a chance!
9' – GOAL! Senegal 0-1 Algeria. Riyad Mahrez is completely unmarked to run onto a free-kick from the halfway line from Bougherra and slot the ball under Coundoul. Where was the right back Djilobodji?
16' – SAVE! Ghoulam tries a Ronaldo-style free-kick striking through the ball from 40 yards, but Coundoul is able to make a comfortable save.
20'- SAVE! Coundoul beats out Soudani's left-footed shot from the left channel, following a crossfield pass from Brahimi.
49' - SAVE! Pape Souare of Lille takes the free-kick 30 yards from goal on the left-hand side of the area, but M'Bolhi is able to save the low shot easily.
60' – CHANCE! Mane is off balance as he attempts to turn on a cross from the right and another Senegal chance goes begging.
74' - SAVE! Coundoul saves from Soudani following Mahrez's cross from the right, after Kara had blocked the initial Taider effort.
81 - GOAL! Senegal 0-2 Algeria. Feghouli sets up Bentaleb on the edge of the Senegal area, and the Tottenham midfielder lashes the ball left-footed past Coundoul and into the far corner of the Senegal goal.