Eric Bailly missed from the spot as Egypt progressed to the quarter-finals of the Africa Cup of Nations by knocking out Ivory Coast on penalties.
The most frequently contested match in the tournament's history – this was the 11th time these sides have met – was decided when Mohamed Salah swept home to secure a 5-4 win in the shoot-out after 120 goalless minutes in Douala.
In a tight first 90 minutes of few chances, arguably the best fell to Amr El Soleya, who blasted over after being teed up in space by Salah.
Egypt goalkeeper Mohamed El Shenawy tipped over a Sebastien Haller header before keeping out a Wilfried Zaha effort, but he was replaced with two minutes of normal time left due to injury.
A bright start from Egypt to extra time saw El Soleya presented with another chance, the Al Ahly midfielder unable to keep his awkward header down from six yards out.
A speculative Ibrahim Sangare strike was well saved by Mohamed Abou Gabal, and Simon Deli got in front of the replacement goalkeeper from the resulting corner only to head over.
Salah's cut-back set up Trezeguet with practically the final kick of extra time, but the Aston Villa man shot straight at Badra Ali Sangare from six yards.
The opening four penalties of the shoot-out were scored before 'Gabaski' clawed Bailly's effort onto the crossbar, the Manchester United defender's run-up not fooling the keeper.
Zaha swept home to put the pressure on Salah, who found the bottom-right corner to set up a last-eight meeting with Morocco.