A 3-0 victory for Ivory Coast over Tunisia at the Royal Bafokeng Sports Palace followed by a shock 2-0 win for Togo against Algeria in a game marred by a long late stoppage to mend a goal, meant the Ivorians finished top irrespective of the final group results.
Algeria were the first team eliminated from the tournament, a massive blow for a side ranked 22nd in the world who had high hopes of getting to the knockout stages.
It was an emphatic display from Ivory Coast, who started with their captain Didier Drogba on the bench, and reaffirmed their status as tournament favourites with an aggressively attacking game led by an imperious Yaya Toure.
He got the second goal, sandwiched between strikes from Gervinho and Didier Ya Konan as the Ivorians won a second successive group match but in a far more convincing style than their limp start.
Drogba being dropped for the first time threatened to overshadow the Ivorian performance but such was the style and margin of their victory that they were irritated by questions afterwards about his absence.
"I'm not the manager and it wasn't my decision. Don't try to make a big deal out of the fact that I was on the bench because it's not," the 34-year-old Drogba said.
He did come on for the last 25 minutes when the Ivorians led 1-0 through Gervinho's first-half goal - an audacious exchange of passes with Lancina Traore in the Tunisia penalty box.
Toure and Ya Konan scored from almost identical positions late in the game to give the scoreline a better reflection of the Ivorian power and prowess.
On a day when Drogba was dropped, another major African footballer Emmanuel Adebayor emerged as the hero yet again for his country.
His 32nd-minute goal set Togo on their way to only their third win in 19 matches at the finals.
The small west African country, who often punch above their weight, can qualify for the knockout stage for the first time in seven attempts if they draw with Tunisia in their last group game in Nelspruit on Wednesday.
Adebayor was not even certain to play in the tournament in South Africa until just days before Togo arrived. The Tottenham Hotspur striker's wavering over his participation led coach Didier Six to initially him out of the 23-man squad only to be overruled the country's football federation boss.
But Six celebrated with unrestrained joy as the tall striker outran the Algerian defence to slot home an opportunity on the counter-attack.
Togo lived dangerously throughout the game, seeing off a furious onslaught from a desperate Algeria in the closing stages.
Just as the match headed to a thrilling climax, the goal posts were dislodged by Algerian midfielder Adlene Guedioura running into the back net, leading to a bizarre 13-minute stoppage while a group of men tried to sort it out.
After the retstart, Togo added a second goal through substitute Dove Wome in the lengthy spell of time added on as the referee miscalculated how long was left to play.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.