Algeria and Ghana have progressed to the quarter-finals of the Africa Cup of Nations following final group stage victories over Senegal and South Africa respectively in Mongomo.
Ghana, on the other hand, came from a goal down to beat South Africa 2-1 and book their place in the knock stages as Group C winners.
The Ghanaians had looked dead and buried come the final 20 minutes as they trailed 1-0 courtesy of a Mandla Masango pile driver from inside the penalty box.
Substitute John Boye changed that just three minutes later, however, as he scored Ghana's first ever Africa Cup of Nations goal against South Africa after latching on to Andre Ayew's scuffed shot and slotting the ball underneath the oncoming Nhlanhla Khuzwayo.
With Algeria 1-0 up in the other fixture, Ghana needed another goal to avoid going out to Senegal on their head-to-head record.
This was to come just seven minutes from time when Ayew bravely headed home Baba Rahman's left-wing cross to send his team into raptures.
Goals from Riyad Mahrez and Nabil Bentaleb ensured Algeria's safe passage into the quarter-finals as they proved too strong for previous group toppers Senegal.
Knowing only a win would guarantee them progression to their first knockout appearance since 2004, Algeria were quick out of the blocks.
Their early pressure was rewarded in the 11th minute when Mahrez was found in acres of space following a long diagonal free-kick by Faouzi Ghoulam.
Mahrez neatly brought the ball down before slotting it past Senegalese goalkeeper Bouna Coundoul to put his side one up.
Algeria's second came just eight minutes from time when Sofiane Feghouli picked up a loose ball before laying it across the edge of the area to Bentaleb, who took a touch before lashing a left-footed drive past Coundoul.
Action continues in Equatorial Guinea tomorrow with Cameroon taking on the Ivory Coast while Guinea face Mali.
All four teams are level on two points apiece in this group following draws in each of the opening four fixtures.
Contact the writer of this story at [email protected]
January 2015: Democratic Republic of Congo and Tunisia through to Africa Cup of Nations quarter-finals
January 2015: Congo and Equatorial Guinea earn surprise African Nations Cup quarter-final berths
January 2015: Ivory Coast salvage late draw against Mali to leave group exactly level
January 2015: Deadly Gyan strikes late to give Ghana dramatic win over Algeria
January 2015: Tunisia complete remarkable comeback to topple Zambia at Africa Cup of Nations