Tunisia defeated Ghana on penalties to set up an Africa Cup of Nations quarter final with Madagascar.
Goalkeeper Farouk Ben Mustapha was the hero, coming on for the shootout and saving Caleb Ekuban’s penalty.
Tunisia had been seconds away from winning in 90 minutes, but substitute Rami Bedoui headed into his own net in injury time, with his first touch.
They had led in Ismailia through Taha Yassine Khenissi’s goal from Wajdi Kechrida’s cross.
Ekuban was the only player to fail with his kick in the shootout, with Ferjani Sassi scoring the winning kick.
Tunisia now face Madagascar, ranked 108th in the world, on Thursday, despite not having won a game in 90 minutes.
The Carthage Eagles drew all three group games before their penalty shootout win over Ghana.