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
-
CSIR Executive Director urges farmers to adopt technology for improved farming
7 mins -
Football Impact Africa’s Ghetto Love Initiative inspires change in Teshie
18 mins -
Peter Toobu calls for tighter border security over uncovered weapons at Tema Port
21 mins -
Gov’t has failed its commitment to IPPs – Ablakwa
25 mins -
Sell Chrome to end search monopoly, Google told
36 mins -
KATH to install seven new dialysis machines by end of November
40 mins -
Walewale: Police confiscate 37 bags of cocoa beans suspected of being smuggled out of Ghana
51 mins -
‘Expired’ Rice Scandal: FDA confirms rice was safe for consumption after rigorous lab tests
56 mins -
Many women have experienced intimate partner violence – Angela Dwamena Aboagye
1 hour -
Power challenges persist due to government’s mismanagement of revenues – Okudzeto Ablakwa
2 hours -
Jordan Ayew injury not as bad as feared – Leicester City boss
2 hours -
Stonebwoy heads to North America for UP & RUNNIN6 tour
2 hours -
FDA explains extension of best-before date for ‘expired’ rice
2 hours -
Rebecca Akufo-Addo, Mahama storm Akuapem North as NPP NDC slugs it out
2 hours -
Fatawu’s injury a big blow for us – Leicester City manager
2 hours