Egypt knocked out Morocco to reach the Africa Cup of Nations semi-finals as substitute Mahmoud Abdel-Moneim prodded home a dramatic 87th-minute winner.
Mohammed Salah had twice been denied by Munir Mohamedi, but prior to the goal Morocco missed a host of good chances.
Aziz Bouhaddouz failed to connect with a cross from two yards out, before seeing a header deflected just wide.
And Morocco defender Romain Saiss and midfielder Mbark Boussoufa were both denied by the crossbar.
Egypt go on to play Burkina Faso, who beat Tunisia 2-0 in their quarter-final on Saturday.
In Sunday's other quarter-final, Ghana beat DR Congo 2-1 to set up a meeting with Cameroon, who knocked out Senegal.
Egypt - the most successful side in Africa Cup of Nations history with seven titles - are yet to concede a goal in Gabon on their return to the competition after a seven-year absence.
Africa Cup of Nations last four
- Burkina Faso v Egypt (Wednesday, 20:00 GMT)
- Cameroon v Ghana (Thursday 20:00 GMT)
-BBC