Mohamed Salah scored one goal and assisted on another as Egypt defeated Morocco in the Africa Cup of Nations quarter-finals in extra time.
Sofiane Boufal gave Morocco an early lead with a penalty after Ayman Ashraf was adjudged to have collided with Achraf Hakimi.
Salah, however, tapped in an equaliser following a parried header by Yassine Bounou, and the game headed to extra time.
Salah squared the ball for Aston Villa’s Trezeguet to put in the winner.
The seven-time champions may have to play with third-choice goalkeeper Mohamed Sobhi, who came on for his international debut when Gabaski injured himself sending Nayef Aguerd’s header off the bar near the end of normal time.
Without that save, there would have been no semi-final – and Salah would have returned to England on the following flight.
Boufal’s penalty was the only noteworthy opportunity for either team in the first half, with the majority of other attempts coming from long range.
Morocco began to dream of reaching their first semi-final since 1988, but Salah had other plans, forcing extra time and then assisting in its conclusion by setting up half-time substitute Trezeguet.
Salah has been involved in 64% – nine of 14 – of Egypt’s goals at the Africa Cup of Nations since making his competition debut in 2017.
Egypt should have added a third just before the final whistle when Morocco goalkeeper Bounou came up for a free kick. Morocco kept it simple, but Egypt’s counter-attack was a disaster, with Salah shooting into the side-netting.
Egypt will play hosts Cameroon on Thursday.