Tunisia beat Ghana on punishments to set up an Africa Cup of Nations quarter-last with Madagascar.
Goalkeeper Farouk Ben Mustapha was the legend, going ahead for the shootout and sparing Caleb Ekuban's punishment.
Tunisia had been seconds from winning in an hour and a half, yet substitute Rami Bedoui headed into his own net in damage time, with his first touch.
They had driven in Ismailia through Taha Yassine Khenissi's objective from Wajdi Kechrida's cross.