Seven-time winners, Egypt knocked out Morocco to reach the 2017 Africa Cup of Nations (AFCON) semi-finals in Gabon on Sunday 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.
Moroccan defender Romain Saiss and midfielder Mbark Boussoufa were both denied by the crossbar.
Egypt will on Wednesday, play Burkina Faso, who beat Tunisia 2-0 in their quarter-final on Saturday.
Substitue for Burkina Faso, Aristide Bance had on Saturday, scored with a low drive from a free-kick only five minutes after coming off the bench.
Prejuce Nkoulma made sure of the victory on the counter-attack, after Tunisia had thrown everyone forward, rounding the goalkeeper 40 yards out before the ball into an empty net.
In Sunday’s other quarter-final, Ghana beat DR Congo 2-1 to set up a Thursday meeting with Cameroon, who also knocked out Senegal on Saturday.
Aston Villa’s Jordan Ayew opened scoring in the 62nd minute, curling the ball past Ley Matampi in the Leopards’ goal.
Paul-Jose M’Poku equalised for DR Congo with a sensational curling long-range effort from outside the penalty area.
West Ham’s Andre Ayew then coolly dispatched a winning penalty kick, sending Matampi the wrong way to seal the win in the 78th minute.
Egypt – the most successful side in AFCON history with seven titles – is yet to concede a goal in Gabon on their return to the competition after a seven-year absence.
But Morocco’s boss Herve Renard’s bid to become the first manager to win three AFCON titles with three different countries is now over.
The Frenchman led Zambia to unlikely triumph in 2012, and won the 2015 title with Cote D’Ivoire.
On a pitch which has been criticised for its poor quality, his side created the greater number of clear opportunities to score.
But they were wasteful in front of goal and were made to pay as extra-time loomed.
From an Egypt corner kick which Morocco failed to clear, the ball dropped kindly to 22-year-old forward Abdel-Moneim, also known as Kahraba, who brought home the winner.