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
-
GDNR, AAU and others launch Universal Acceptance for local languages in internet domain names
8 mins -
Ogum and Kotoko’s March malaise
2 hours -
2 repair vessels dispatched for undersea cable repairs – says NCA’s latest update
2 hours -
Multimedia Group Limited’s Clinton Yeboah shortlisted for 2 International Sports Press Association Awards
3 hours -
Supreme Court upholds High Court verdict on fraudulent sale of property by Senior Police Officer
3 hours -
NHIS Biometric Membership Authentication System limited rollout satisfactory – NHIA Deputy CEO
3 hours -
Yara Ghana donates 1,107 bags of fertilizers to women farmers, farmers with disabilities
3 hours -
Tinubu forms team to find solutions to ailing economy
3 hours -
Jacob Zuma barred from running in South Africa election
3 hours -
Western Cape Education wins national primary school track and field championships
4 hours -
Cyber Security Authority issues Public Alert over Easter and Eid al-Fitr season scams
4 hours -
Sandro Tonali charged by FA for alleged betting rules breaches after joining Newcastle
4 hours -
Scancom PLC holds 6th AGM, declares dividend of 17.5 pesewas per share
4 hours -
Former Deputy AG accuses Godfred Dame of unethical legal behaviour
4 hours -
John Kumah goes home on May 18
4 hours