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.
Television replays did not support his decision but Partey was offside anyway before he laid the ball off for Dede Ayew to finish.
Ghana centre back Kasim Adams headed against the upright from a corner in the 15th minute and Mubarak Wakaso struck the bottom of the post near the end of the game.
The introduction of Wahbi Khazri, who had been doubtful before the game, proved a tonic for Tunisia and he had a powerful strike in extra time that Ghana goalkeeper Richard Ofori did well to tip over the bar.
With five minutes left Jordan Ayew might have won it for Ghana but miscued his shot and watched in agony as his close-range effort went wide.
Tunisia changed their goalkeeper just before the shootout although Mouez Hassen looked perplexed and angered by coach Alain Giresse’s decision to replace him with Farouk Ben Mustapha.
But it proved a master stroke as Ben Mustapha’s save from Caleb Ekuban in the shootout handed Tunisia success.
The stalemate after two hours of football means Tunisia are in the last eight despite four draws at the tournament, having laboured through the group phase.