The Pharaoh's of Egypt handed the Black Stars of Ghana their first loss of AFCON 2017 on Wednesday at the Stade de Port Gentil.
The result sends Egypt through to the next stage as winners of Group D earning them a quarter-final with Morocco in Port Gentil.
The Stars who finished second in Group D will now head to the Stade d'Oyen to play giant-killers DR Congo. AS Roma winger Mohamed Salah gave his side the lead from an exquisite free kick that left Ghana goalie Razak Brimah rooted to the spot.
Salah capitalised on an infringement on Egyptian forward Abdalla El Said by Jonathan Mensah to rifle home powerfully in the 11th minute.
The Stars were dealt what may prove to be a massive blow to their 2017 AFCON chances when skipper Asamoah Gyan pulled up short after a sprint.
Avram Grant decided to substitute his captain Gyan as a precautionary measure. Aston Villa man Jordan Ayew replaced him with four minutes to end the first half.
Ghana goalkeeper who has been a steady presence so far at this year's AFCON was back to his nervy ways moments later when a costly error almost gifted the Egyptians their second goal.
The Egyptians sat back after the break and were content to hit their industrious Ghanaian opponents on the break who dominated possession but were unable to penetrate the stubborn Egyptian defence.
Jordan Ayew came close to grabbing the equaliser in the 89th minute but his fierce drive was parried by Essam El Hadary. The other Group D clash ended in a 1-1 draw between Mali and Uganda.