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
-
Why Talent, Not Politics, Should Define Our Leaders
2 hours -
Stanbic Bank holds close-out ceremony for maiden STEM Graduate Trainee Programme
4 hours -
Gas explosion at University of Ghana’s Bush Canteen destroys several stalls
4 hours -
Ghana and Rwanda sign MoU to enhance cross-border fintech agreement
4 hours -
Liverpool go 13 points clear with 2-0 win over Newcastle
4 hours -
‘No perfect system, but generic claims are hard to address’ – Dutch ambassador responds to Foreign Ministry communiqué
5 hours -
Unemployment rate in Ghana to remain at average 4% in 2025 – Fitch Solutions
5 hours -
Upper Manya Krobo NDC distance itself from calls to force Mahama to nominate Minister, DCE
6 hours -
Man convicted for selling unauthorised drugs in Tamale
6 hours -
AGA equips basic schools in Obuasi with first aid skills
6 hours -
Ebenezer De-Gaulle: Resetting Ghana through Digital Cheetah Generation
6 hours -
Energy Minister John Jinapor engages partners of East Cape Three Point Block
6 hours -
Systematic failures led to NPP’s 2024 election defeat – Appiah-Kubi
6 hours -
Ghana Link refutes reports on weighbridge system at Tema Port
7 hours -
Man shot dead in Sagnarigu after a dispute
7 hours