Ferjani Sassi scored the winning penalty in sublime fashion as Tunisia's Carthage Eagles flew over Ghana's Black Stars to progress to the quarter finals of the Total Africa Cup of Nations (AFCON) Egypt 2019 with a 5-4 post-match penalties victory.
Tunisia will now face off with tournament surprise package Madagascar in Thursday's quarter final in Al Salaam.
Substitute keeper Farouk Ben Mustapha proved a gamble by head coach Alaine Giresse to bring him on for the penalties to be right as he saved one of Ghana's kicks from Caleb Ekuban.
Tunisia all scored their penalties with Naim Sliti, Wahbi Khazri, Yassine Meriah and Dylan Bronn all scoring before Sassi sealed the tie. Ghana's kicks were scored through Mubarak Wakaso, Jordan Ayew, Lumor Agbenyenu and Thomas Partey.
Substitute Rami Bedoui's own goal at the stroke of full time sent the game to extra time after he dipped a header beyond his keeper Hassen Mouez as he tried to defend a Mubarak Wakaso freekick.
Bedoui had just been brought on to try and safeguard Tunisia's 1-0 lead in the final minutes of the game, but his change was counter-productive.
Tunisia had gone ahead in the 72nd minute courtesy of a Taha Khenissi goal, but, as though fate would have it, the man who replaced him after 90 minutes undid the work he had done just 18 minutes earlier.
While it was Khenissi who scored Tunisia's goal in the regular 90 minutes, it was the experience of Wahbi Khazri off the bench that turned the game into Tunisia's favor.
Khazri came on in the 67th minute for Anice Badri and immediately, Tunisia's game in the final third changed. Within two minutes of his presence, Tunisia came close when he ct back a cross from the left for Khenissi to shoot home, but the effort was blocked by Nuhu Kasim.
In the 70th minute, Khazri swung in a corner from the right met by Khenissi again, this time the striker's effort being denied by the crossbar.
But two minutes later, his industry paid off when he won the ball on the right before playing Wajdi Kechrida through with the right back's low cross into the box being turned home beyond Richard Ofori by Khenissi.
Before Khazri's arrival, it was Ghana who had the best scoring chances and they felt as though they should have gone to the break a goal up but had a late first half goal disallowed.
Skipper Andre Ayew back-heeled the ball into the net off his brother Jordan's cross, but the goal was disallowed for a handball in the build-up.
Ghana had another close chance quarter of an hour into the game when Kasim's header from a Wakaso corner struck the upright while Andre Ayew had his effort from the rebound saved by the keeper.
With Tunisia's late own goal, the game was forced into extra time and even then, it was a full contest despite the tired legs. Khazri forced a great save off Ofori with a strong shot from the edge of the area while Jordan Ayew fluffed Ghana's best chance of the extra 30.
Asamoah Gyan who was a late second half substitute brushed a header his way, but his technique on the colley was awry, the ball going wide.
Total Man of the match: Mubarak Wakaso (Ghana)
What they said:
Ghana coach Kwesi Appiah:
Actually I feel bad after the loss. It was a very tough game and expectations on us were high. We did our best but when it comes to penalties, it can go either way. We had a lot of chances to score and a goal disallowed.
I think VAR will help African football. If there was VAR, that goal would have stood. We had the chances and we could have finished it in normal time. We have to comfort the players. What you have to do is to make use of what you have learnt in the competition.
Tunisia coach Alain Giresse:
We have been reminded by the result today that we have to be concentrated during the entire 90 minutes. It was a difficult game but my players responded well to the difficulty. Bringing Ben Mustapha (second choice keeper) on was a decision I had taken during the game but I didn't know it would work.