TOGO took the last quarter-final place at the African Nations Cup to maintain the flow of outsiders into the last eight at the end of the group phase on Wednesday.
A 1-1 draw with Tunisia in Nelspruit ensured the point they needed to finish second behind the Ivory Coast in Group D and a first place in the last eight after failing in their seven previous attempts.
The Ivorians, fielding their second-string side but restoring Didier Drogba to the team, came from two goals down to draw 2-2 with Algeria in a dead rubber in Rustenburg having already secured top place.
Togo now join the other unfancied countries, the Cape Verde Islands and Burkina Faso, in the knockout stage of a tournament strewn with upsets.
They will face Burkina Faso in the last of the quarter-finals on Sunday in Nelspruit.
Togo faced a surprisingly timid showing from former winners Tunisia, who had to win the game to progress, plus several controversial calls in a game in which South African referee Daniel Bennett took centre stage.
Bennett awarded Tunisia a penalty in each half, denied Togo captain Emmanuel Adebayor a legitimate-looking claim and booked the wrong Togolese defender in a final 20 minutes of near pandemonium at the Mbombela Stadium.
Khalid Mouelhi's failure to convert the second penalty in the 78th minute effectively cost his side their chance to progress but, in truth, Tunisia lacked the necessary attacking rigour to force the desired result.
Togo's Emmanuel Adebayor celebrates scoring the opening goal of the game
Mouelhi did score the first spot-kick on 30 minutes when Dare Nibombe was penalised for holding on to Tunisia's Walid Hicheri in a wrestling tussle as he was defending a corner.
Tugging and pulling between players at set pieces has become commonplace and largely unchecked but Bennett bucked the trend by awarding a penalty.
Togo had the cushion of an early goal in the 13th minute when Serge Gakpe looked offside as he collected a sublime pass from Adebayor but the goal was allowed to stand.
Adebayor's penalty appeal came as he wriggled free of the Tunisia defence to go one-on-one with goalkeeper Moez Ben Cherifia and went tumbling down as he attempted to round him.
Togo were still arguing the decision to ignore the claim when Bennett handed another penalty to Tunisia, again against Nibombe for clipping Saber Khlifa from behind by Nibombe. It further inflamed an already ill-tempered affair and four Togo players were booked in quick succession.
However, Mouelhi struck his shot against the upright.
"Togo showed its quality and its heart. I'm very happy for Togo, we were the little team in this group," said coach Didier Six.
Ivory Coast fight back to earn draw
Tournament favourites and Group D winners Ivory Coast battled back from two goals down to draw 2-2 with already-eliminated Algeria who at least left the African Nations Cup with their pride restored on Wednesday.
All four goals came in a 16-minute spell in the second half with Algeria taking the lead in the 64th minute with substitute Sofiane Feghouli scoring two minutes after coming on for Ryad Boudebouz, who missed a penalty in the first half.
They doubled their lead six minutes later when Hilal Soudani thundered in a header after escaping his marker and meeting a long perfect cross from Feghouli wide on the right.
The Ivorians, who had already qualified for the knock out stages before Wednesday's match, struck back in the 77th minute when Didier Drogba outjumped the defence to head home.
Algeria's Sofiane Feghouli (L-R), Hilal Soudani and Islam Slimani celebrate a goal
They equalised three minutes after that when a powerful shot from Wilfried Bony took a huge deflection off Algerian defender Djamel Mesbah.
Algeria were eliminated after losing their opening two games to Tunisia and Togo, while Ivory Coast boss Sabri Lamouchi rested nine players ahead of Sunday's quarter-final against Nigeria in Rustenburg.
Drogba returned to the Ivorian starting line-up but whether that was to give him more match time after his two-month layoff following the end of the Chinese season in November or because he is no longer regarded as a first choice striker will be seen when Lamouchi names his side to face Nigeria.
Drogba, who looked unimpressive in the opening two matches, did look far more involved in an admittedly low-key game, and should have scored five minutes before halftime but fired over the bar after cleverly creating an opening at the edge of the box.
Ivory Coast's goalscorer Didier Drogba reacts to an injury during the game
His perseverance paid off and he made no mistake with his well-taken goal that brought Ivory Coast back into the game.
With little but pride at stake, the match took a long time to come to the boil, but the ending was dramatic as Ivory Coast showed some real character in the closing stages.
Gabon referee Eric Otoga-Castane may have treated Ivory Coast harshly for the first penalty when Soudani appeared to dive into the box.
But there was no mistake about the second when Arthur Boka handled, giving Sofiane the chance to lash the ball home from a two-step run-up.