Pharaohs secure semi spot
A tense last-eight tie in Port-Gentil seemed destined for extra time until Kahraba, on as a substitute, poked the ball over the line after the Moroccan defence had failed to cut out a corner.
The Pharaohs, record seven-time winners of the trophy, now advance to a semi-final against Burkina Faso in Libreville on Wednesday after claiming a rare victory against their north African rivals.
The 1-0 scoreline also means Hector Cuper's side have still not conceded a goal in four games in Gabon.
Dream ends for Renard
Given the identities of the two coaches, this tie always looked likely to be a close-fought tactical battle and so it proved on a dreadful pitch in Port-Gentil that the tournament can be glad to see the back of.
Renard opted to play with three centre-backs, Romain Saiss joining Manuel Da Costa and skipper Mehdi Benatia in the middle of the defence as they looked to suffocate the Egyptian attack.
It was a largely successful tactic but the first half was almost totally devoid of real incident.
Egypt did threaten once when Nabil Dirar failed to clear at the back post and Trezeguet's effort was saved by Munir Mohamedi.
A livelier start to the second period saw the Moroccan 'keeper produce a strong arm to block a Mohamed Salah effort before the pocket-sized midfielder M'bark Boussoufa struck the bar at the other end.
The bulk of the support in the stadium was for Morocco and the bulk of the chances were going their way too in their first knockout round appearance since 2004.
But striker Aziz Bouhaddouz, who scored in the group-stage win against Togo, somehow could not connect with Faycal Fajr's driven ball inside the six-yard box and then headed narrowly wide.
Salah was the danger man for the Egyptians and when Abdallah El Said chipped a free-kick over the wall and into his path, the Roma star's effort was spectacularly saved by Munir.
Extra time loomed but then Kahraba struck to spark wild Egyptian celebrations and break Moroccan hearts.
Black Stars march on
Ghana reached the African Nations Cup semi-finals for the sixth time in a row after brothers Jordan and Andre Ayew secured a 2-1 win over the Democratic Republic of Congo in a rough-and-tumble match on Sunday.
The goals came in a 15-minute second-half spell as Jordan Ayew put the Black Stars in front in the 63rd minute, Paul-Jose Mpoku equalised with a stunning long-range strike five minutes later before Andre Ayew's penalty settled the match.
Ghana, who won the last of their four titles in 1982, will face Cameroon in the semi-finals on Thursday.