Alain Giresse’s side drew all three of their group games but seemed set for a first victory thanks to Taha Khenissi’s second-half strike, only for substitute Rami Bedoui to head an own goal with his first touch in added time.
Tunisia sent on goalkeeper Farouk Ben Mustapha to replace Mouez Hassen ahead of the shoot-out and he kept out Caleb Ekuban’s poor effort, allowing Ferjani Sassi to hit the winning spot-kick and book a last-eight clash with tournament debutants Madagascar.
Kasim Adams hit the post with a header and Andre Ayew was unable to convert the rebound as Ghana started on top at Ismailia Stadium on Monday.
Ghana had the ball in the net before half-time, Andre Ayew flicking home from close range, but the goal was disallowed as Thomas Partey was offside in the build-up.
Tunisia’s star man Wahbi Khazri was not deemed fit enough to start but was thrown on midway through the second half with the game in the balance.
Khazri was immediately in the thick of the action with Khenissi heading his corner against the crossbar, before Tunisia found the breakthrough in the 73rd minute.
A Khazri backheel freed Wajdi Kechrida and Khenissi arrived to steer home the low cross, his deflected shot clipping the inside of the post.
Hassen made a brilliant save to tip Mubarak Wakaso’s curling effort onto the woodwork but the Black Stars equalised in the 91st minute.
Adams floated a free-kick into the box and Bedoui – who had just replaced Khenissi – sent a looping header into his own net.
Jordan Ayew missed the best chance in extra time and Tunisia, who had not beaten Ghana in seven previous AFCON attempts, progressed as Giresse’s decision to send on Ben Mustapha for the penalties paid off.