Egypt made it through to the last 16 at the Africa Cup of Nations after drawing 2-2 with Cape Verde following a dramatic finale to Group B in Abidjan.
Egypt had looked set to finish third behind the Blue Sharks and Ghana before stoppage-time goals in both games.
Pharaohs forward Mostafa Mohamed netted what looked to be a 93rd-minute winner.
However, Cape Verde levelled six minutes later and the Pharaohs secured second spot as Ghana threw away a 2-0 lead in added time against Mozambique.
Rui Vitoria’s side will face the second-placed finisher in Group F in the last 16 on Sunday (20:00 GMT).
Egypt, with the injured Mohamed Salah watching on, trailed at the break through Benchimol’s smart finish but half-time substitute Trezeguet volleyed them level in the 50th minute.
The Pharaohs had known victory would be good enough to send them through in second place and, with Ghana leading Mozambique, they celebrated wildly after Mohamed lobbed Vozinha to put them 2-1 up in added time.
But drama followed after the Video Assistant Referee (VAR) sent match official Alhadi Mahamat to his pitchside monitor to rule whether Mohamed had controlled Trezeguet’s ball forward with his chest or hand.
The Chadian official eventually confirmed the goal, yet Egypt almost threw away all their hard work when Bryan Teixeira fired in from a narrow angle.
However, Ghana had somehow conspired to concede a 91st-minute penalty and a 94th-minute equaliser against Mozambique, which meant Egypt progressed to the knockout stages despite drawing all three group games in Ivory Coast.
Trezeguet steps up as Salah watches on
Salah had been ruled out after being forced off during the 2-2 draw with Ghana last Thursday, but the forward was in the stands for what proved to be a nervy evening for the record seven-time continental champions.
The 31-year-old will return to Liverpool for treatment on his leg injury – and agent Ramy Abbas Issa has cast doubt on whether Salah will even be fit should Egypt reach the final on 11 February.
The Pharaohs trailed at the break despite bossing the first period, and Trezeguet epitomised their renewed purpose when he fired over straight after the restart.
After a smart one-two with Ahmed Hegazi the former Aston Villa man’s left-footed volley had enough power to go through Vozinha’s legs.
Trezeguet was at the heart of Egypt’s best openings, firing wide from range and forcing Vozinha to palm away a curling effort, and it was no surprise he unlocked the Cape Verde defence for Mohamed’s goal.
Cape Verde had already secured top spot in Group B before facing the North Africans and a much-changed side showed their mettle to equalise in the dying stages.
Some Pharaohs players sank to the turf in despair after Teixeira made it 2-2, assuming Ghana had claimed victory, yet the delay before the restart worked in their favour as they were informed a point was enough to progress.
Egypt were runners-up at the 2017 and 2021 finals and, after squeezing through to the knockout stages, still retain hope of Salah returning to clinch a first Afcon title since 2010.
- 1Évora Dias
- 17Johnson Semedo Afonso
- 5Evans Costa
- 3Monteiro Sanches Borges
- 16Tavares dos Santos
- 26Gonçalves Pereira de PinaBooked at 71minsSubstituted forPereira Fernandesat 75′minutes
- 20Mendes da GraçaSubstituted forMoreiraat 64′minutes
- 6Correia AndradeSubstituted forMoreira Fernandesat 70′minutes
- 18Rocha Santos
- 11Mendes RodriguesSubstituted forMonteiro Alvarengaat 64′minutes
- 9Benchimol TavaresSubstituted forSilva Teixeira Jr.at 64′minutes
- 2dos Santos Tavares
- 7Borges Cabral
- 8Moreira Fernandes
- 10Monteiro Alvarenga
- 12Salomão Brazão da Rosa
- 13Pereira Fernandes
- 14D’Encarnação Duarte
- 15d’Encarnação Duarte
- 19Silva Teixeira Jr.
- 24Garcia da Silva
- 16El Shenawy GomaaSubstituted forAbou Gabal Aliat 90+12′minutes
- 3Gamal Eldemerdash
- 6HegazyBooked at 88mins
- 24Mohamed Ahmed
- 13MohamedSubstituted forHamdy Mahmoud Sharfedinat 45′minutes
- 5Abdel FattahSubstituted forTrézéguetat 45′minutes
- 25SayedSubstituted forKahrabaat 74′minutes
- 22MarmoushBooked at 63minsSubstituted forAbdel Hameid Mohamed Abdallaat 83′minutes
- 4Abdel Wahed
- 9Mohamed Mahgoub
- 12Hamdy Mahmoud Sharfedin
- 15El Hanafi
- 18Abdel Hameid Mohamed Abdalla
- 23Abou Gabal Ali
- 27Ahmed Abdelmonem
- Alhadi Allaou Mahamat
Match ends, Cabo Verde 2, Egypt 2.
Second Half ends, Cabo Verde 2, Egypt 2.
Substitution, Egypt. Mohamed Abou Gabal replaces Mohamed El Shenawy because of an injury.
Delay over. They are ready to continue.
Delay in match because of an injury Mohamed El Shenawy (Egypt).
Goal! Cabo Verde 2, Egypt 2. Bryan Teixeira (Cabo Verde) right footed shot from the right side of the six yard box to the bottom right corner.
Corner, Cabo Verde. Conceded by Ahmed Hegazy.
VAR Decision: Goal Egypt – Cabo Verde 1-2 Egypt (Mostafa Mohamed).
Goal! Cabo Verde 1, Egypt 2. Mostafa Mohamed (Egypt) right footed shot from the centre of the box to the centre of the goal. Assisted by Trézéguet.Goal confirmed following VAR Review.
Corner, Egypt. Conceded by Willy Semedo.
Attempt blocked. Mostafa Fathi (Egypt) left footed shot from the right side of the box is blocked.
Corner, Egypt. Conceded by Logan Costa.
Ahmed Hegazy (Egypt) is shown the yellow card for a bad foul.
Foul by Ahmed Hegazy (Egypt).
Jamiro Monteiro (Cabo Verde) wins a free kick in the defensive half.
Corner, Egypt. Conceded by Vózinha.
Attempt saved. Emam Ashour (Egypt) left footed shot from outside the box is saved in the top left corner. Assisted by Ahmed Hegazy.
Attempt saved. Bryan Teixeira (Cabo Verde) header from the centre of the box is saved in the centre of the goal. Assisted by Logan Costa with a headed pass.
Corner, Cabo Verde. Conceded by Emam Ashour.
Attempt missed. Mostafa Mohamed (Egypt) right footed shot from the centre of the box is too high. Assisted by Trézéguet.