Togo survived a controversy-filled match against Tunisia to become the last team to advance to the African Cup of Nations quarterfinals on Wednesday.
Meanwhile, Didier Drogba returned to Ivory Coast's lineup and helped the tournament favorite rally for a 2-2 draw against already-eliminated Algeria.
Emmanuel Adebayor's Togo held on for 1-1 with Tunisia to advance past the group stage for the first time in eight appearances. Tunisia, which needed the win to move on, missed a potentially game-winning penalty kick in the second half.
Togo will stay in Nelspruit to face Burkina Faso on Sunday in the quarterfinals, which will be highlighted by the match between Ivory Coast and two-time champion Nigeria on the same day in Rustenburg. Host South Africa will play Mali on Saturday in Durban, while Ghana will face newcomer Cape Verde in Port Elizabeth that same day.
South African referee Daniel Bennett drew attention to himself in the match between Togo and Tunisia, awarding two contentious penalties to Tunisia and turning down several others for both teams.
Serge Gakpe scored the opener for Togo in the 13th minute and Tunisia's Khaled Mouelhi converted the first spot kick to equalize in the 30th, but he hit the upright with the second as the goalkeeper dived the other way.
Togo coach Didier Six and his players were furious with the penalties awarded to Tunisia and complained of allegedly missed calls for them.
"I think the referee was not seeing our penalties,'' said Adebayor, one of three players given a yellow card for complaining. "Today was not his best day. What do you want me to tell you? He had a bad day, but fortunately we found a way out and we're just happy that we're still in (the tournament).''
There was little controversy in Rustenburg, where there was little to be decided between Ivory Coast and Algeria.
There was a lot of hype about the match before the tournament because it featured the two highest-ranked teams in the competition, but interest quickly diminished after 14th-ranked Ivory Coast managed to win its first two matches and 22nd-ranked Algeria failed to win a single point heading into the final group match.
The only question was whether newly signed Galatasaray striker Drogba was going to be benched for the second consecutive time, but he got to play and helped the Elephants come back from a two-goal deficit by scoring his first goal of the tournament with a header in the 77th.
Drogba had a chance to score the winner in stoppage time but couldn't manage more than a weak shot in front of the goal.
Substitute Sofiane Feghouli opened the scoring for Algeria by converting a penalty kick in the 64th and Hilal Soudani added to the lead with a close-range header in the 70th before Bony Wilfried netted the equalizer for Ivory Coast with a shot that deflected off a defender in the 80th.
"What I appreciate the most is my players' reaction in the second half,'' Ivory Coast coach Sabri Lamouchi said through a translator. "They refused to lose, they didn't want to accept the defeat.''
The Algerians, who were yet to score in the tournament despite playing well in the first two matches, missed a penalty kick just seven minutes into the match at Royal Bafokeng Stadium.
"After two games it's nice to have moved forward,'' Algeria coach Vahid Halilhodzic said. "We went through some very hard times. I asked my boys to give me a victory and tonight we were not very far from that.''