Togo qualified for the Africa Cup of Nations quarter-finals for the first time by drawing with Tunisia in an incident-filled Group D encounter.
The Togolese led after 13 minutes as Emmanuel Adebayor played in Serge Gakpe, who fired home from an angle.
Tunisia levelled through a penalty from Khaled Mouelhi shortly after, but the same player missed another spot-kick in a match Tunisia had to win to qualify.
Adebayor was denied a penalty at the other end but Togo held on for history.
The West Africans will now meet Burkina Faso in Sunday's quarter-final in Nelspruit, whose sand-filled surface has attracted scrutiny and criticism in equal measure.
Togo's passage came at a cost after Nibombe Dare and Jonathan Ayite both picked up their second yellow cards of the tournament, so ruling them out of the clash against their northern neighbours.
Dare's booking was highly controversial after South African referee Daniel Bennett, whose performance was littered with poor decisions, erroneously booked the tall defender for a challenge on Youssef Msakni when the foul had actually been committed by Serge Akakpo.
The decision for Hawks coach Didier Six, who cut an animated figure on the sidelines, is whether to appeal against the booking since Akakpo himself received a caution in the 2-0 win over Algeria.
The Frenchman's side dominated the early exchanges, with the front three of Floyd Ayite, Gakpe and captain Adebayor all combining well.
Ayite had the first chance, Adebayor then side-footed wide from 12 yards before the Togo captain slipped in Gakpe after 13 minutes.
Despite being in an offside position when the pass was played, the striker's low finish across Moez Ben Cherifia from just inside the box was allowed to stand.
Togo's 1-0 lead meant Tunisia needed to score at least twice to reach the last eight and Msakni - whose stunning strike enabled the 2004 champions to win their opening game against Algeria - launched Tunisia's first attack moments later with a strike that lacked venom.
Adebayor threatened at the other end when volleying wide but Togo's control on the game was checked when Tunisia were thrown a lifeline.
The Carthage Eagles won a penalty as defender Dare - who played at the 2006 World Cup - belied his experience by pushing Walid Hichri at a corner, with the Tunisian making the most of the challenge.
Despite the pressure, Mouelhi was seemingly nerveless as he wrong-footed Togo goalkeeper Kossi Agassa and slid the ball into the left-hand side of the goal.
Goals may have been in short supply in the second half but there was no shortage of incident as Bennett had a half to forget.
Shortly after the break, Togo defender Vincent Bossou brought down Oussama Darragi for what seemed a stonewall penalty - but after a long look, the official decided against it.
It was then Adebayor's turn to claim two penalties, the first of which was unconvincing whereas the second not only seemed clearcut but could also have warranted a red card for Cherifia after he got nothing on the ball and everything on the Togo striker.
After Darragi forced Agassa into a comfortable save from a free-kick, Msakni also called the Togo keeper into action - but Tunisia's best chance came after Dare conceded his second penalty as Saber Khlifa went down under another slight touch.
Mouelhi stepped up for a second time with the chance to put at least one North African side into the last eight, following the early exits of Morocco and Algeria, but he hit the post with a well-struck effort.
Tunisia coach Sami Trabelsi rang the changes as he searched a much-needed winner and he must have thought substitute Fakhreddine Ben Youssef had decided the game only for the striker to be denied by two superb saves by Agassa in stoppage time.
Six punched the air in delight at the final whistle as Togo reached the quarter-finals at a tournament from which they were originally banned by the Confederation of African Football following their withdrawal from the 2010 Nations Cup - a decision that Fifa later helped to overturn.
Togo coach Didier Six:
"This is huge for Togo - the first time they have qualified for the quarter-finals. We were the little team in this group, and we've made it.
"I think there will be a big party in Lome tonight."
Tunisia coach Sami Trabelsi:
"We did what we had to do, we dominated the play, but we lacked a bit of finishing.
"Am I satisfied with the outcome? Not really."