Mohamed Salah scored one goal and set up the other as Egypt beat Morocco in extra time in the Africa Cup of Nations quarter-finals.
Sofiane Boufal gave Morocco an early lead with a penalty after Ayman Ashraf caught Achraf Hakimi, a decision given by the video assistant referee.
But Salah tapped in an equaliser after Yassine Bounou parried a header and the game went to extra time.
Liverpool's Salah squared for Aston Villa's Trezeguet to tap in a winner.
Carlos Queiroz's side will face hosts Cameroon in Thursday's semi-final.
The seven-time champions may need to play that game with third-choice keeper Mohamed Sobhi, who came on for his international debut after Gabaski hurt himself while tipping Nayef Aguerd's header on to the bar near the end of normal time.
Without that save there would have been no semi-final to worry about - and Salah would have been on the next flight back to England.
Boufal's penalty was the only chance of note for either side in the first half - with most other efforts from long range.
Morocco were starting to dream of only their second semi-final since 1988 but Salah had other ideas, forcing extra time and then helping settle it by setting up half-time substitute Trezeguet.
Salah has been involved in 64% of Egypt's goals at the Africa Cup of Nations - nine of 14 - since he made his competition debut in 2017.
Egypt should have scored a third right at the end after Morocco keeper Bounou came up for a free-kick. Morocco played it short but Egypt made a mess of their counter-attack and Salah shot into the side-netting.
Latest Stories
-
Ghana risks losing port traffic to neighbours over Covid-19 tax – GPHA warns
51 minutes -
Mahama’s to deliver first SONA in second term as he resets Ghana with bold economic vision
1 hour -
We are determined to win the galamsey fight- Vice President
2 hours -
Zelensky to meet Trump in Washington to sign minerals deal
2 hours -
Instagram may launch separate Reels app to take on TikTok – report
2 hours -
Ghana’s 2024 total exports reach GH¢294.9bn
2 hours -
GPHA collaborating with Customs for extension of intrusive container inspections
2 hours -
State yet to receive analytical report on alleged ‘drugs’ found on 3 women
2 hours -
My client is suffering in custody – ‘Sexy Dondon’s lawyer tells court
3 hours -
Saglemi Housing Trial: AG files nolle prosequi to discharge Collins Dauda, others
3 hours -
‘Pilot Training School in Ho to take off by end of 2025’ – Togbe Afede
3 hours -
Amorim will speak to Man Utd’s Garnacho about sub reaction
3 hours -
Endrick scores as Real Madrid beat Real Sociedad in Copa del Rey
3 hours -
Arsenal title hope fades after Forest draw
4 hours -
KNUST food research scientists find harmful banned substances in some tomato paste
4 hours