A last-minute goal by Abdallah El Said ensured that Egypt pick their first win in an Africa Cup of Nations after seven years.
The last came in 2010, when they beat Ghana 1-0 in Luanda, Angola to win the 2010 edition.
They beat Uganda 1-0 on Saturday in their second Group D game played at Port-Gentil, Gabon.
With the Cranes the hungrier of the two sides going into the match following their 1-0 loss to Ghana on the opening day, Egypt had to do more defensive work in the incipient stages of the game.
But it ended all square in the first half and most of the second half.
With a minute for Senegalese referee Malang Diedhiou to end proceedings at the Stade de Port-Gentil, the Pharaohs took advantage of a quick counter, taking the ball as far as into the Cranes’ penalty area.
AS Roma attacker Mohamed Salah’s selfless play in the box found him dummying the Ugandan defence and sending a sublime pass to the Al Ahly striker, who hit the ball through the legs of Africa’s best continent-based player Dennis Onyango.
The result gives Egypt four points, just behind Ghana, while it sends the East Africans packing out of the tournament.
They will, however, play Mali in the final group game on Wednesday.
Egypt will face Ghana in what could be a reminiscence of the 2010 finals.
Sign up for GhanaStar.com to receive daily email alerts of breaking news in Ghana. GhanaStar.com is your source for all Ghana News. Get the latest Ghana news, breaking news, sports, politics, entertainment and more about Ghana, Africa and beyond.