Ferjani Sassi struck the winning spot-kick as Tunisia beat Ghana 5-4 in a penalty shoot-out to secure their place in the Africa Cup of Nations quarter-finals.
Tunisia had led through Taha Yassine Khenissi's 73rd-minute opener but their substitute Rami Bedoui headed an own goal in the closing moments to force extra-time.
After the extra 30 minutes ended goalless, Ghana's Leeds forward Caleb Ekuban was the only player not to score in the shoot-out and it was left to Sassi to coolly convert and secure Tunisia a last-eight clash with Madagascar.
Tunisia had created very little before substitute Khenissi's effort midway through the second half was cleared off the goal-line.
Ellyes Skhiri's header then hit the crossbar and 60 seconds later Khenissi fired the north Africans into the lead after meeting Wajdi Kechrida's cutback at the near post.
The Black Stars equalised in the first minute of stoppage time when Tunisia substitute Bedoui, who had stepped off the bench two minutes earlier, headed Mubarak Wakaso's deep free-kick into his own net with his first touch.
An uneventful first half was overshadowed by referee Victor Miguel de Freitas Gomes' controversial decision to chalk off Andre Ayew's 43rd-minute effort for an apparent handball by Thomas Partey.
Television replays appeared to show the ball had hit Partey on the chest and video assistant referees will not be introduced until the quarter-finals.