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
-
You are lucky I didn’t cite you for contempt – Bernard Ahiafor tells Afenyo Markin
4 minutes -
Energy Ministry withdraws directive seeking to unitize ENI, Springfield and Vitol oil fields
4 minutes -
Non-adherence to family planning results in maternal death and poverty – GHS
11 minutes -
Hilal Committee announces March 1 as starting date of 2025 Ramadan fasting if the moon is sighted
19 minutes -
I didn’t apply for GETFund scholarship, GIMPA selected me – Srem-Sai
20 minutes -
Appointments C’ttee chair abruptly terminates vetting of Deputy AG nominee
40 minutes -
Rex Omar appointed Presidential Staffer for Blackstar Experience
50 minutes -
Mass dismissal: Public sector employment should be devoid of partisan politics – Benjamin Quashie
55 minutes -
Ernest Yaw Kumi: Supreme Court stops Koforidua High Court from sentencing Akwatia MP
1 hour -
DPE2025 delegation confers with Housing Minister
1 hour -
Kofi Okyere Darko appointed Presidential Adviser on Diaspora Affairs
1 hour -
Nestlé Ghana unveils new NIDO packaging: A strong commitment to nutrition & sustainability
1 hour -
24-year-old with vision and hearing impairments appeals for support to procure a pair of hearing aids
1 hour -
ECG anticipates reduction in power losses as Anwomaso electricity generation hub nears completion
1 hour -
‘My dad can’t be a racist’ – Drogba defends Mourinho
1 hour