Uganda has qualified to the round of 16 for the first time since 1978 despite losing to hosts, Egypt at Cairo International Stadium on Sunday.
DR Congo thumped Zimbabwe in Group A’s other game on Sunday, meaning Uganda progress as runners-up.
Liverpool forward Mohamed Salah opened the scoring with a superb free-kick midway through the first half.
Aston Villa’s Ahmed Elmohamady then doubled the Pharaohs’ lead before half-time with a powerful drive.
Uganda’s Farouk Miya and Emmanuel Okwi, who both impressed at the Cairo International Stadium, tested Egypt keeper Mohamed El-Shenawy before Salah broke the deadlock with side’s first shot on target.
And Cranes forward Lumala Abdu was denied twice in quick succession by El-Shenawy before Egypt captain Elmohamady netted his second goal of the tournament with a fine finish from Ayman Ashraf’s cut-back on the brink of half-time.
Uganda continued to apply pressure in the second half and Miya twice went close with whipped free-kicks while Okwi’s poked effort clipped the outside of the post with the keeper beaten.
Hosts Egypt go through to the last 16 with a perfect record having beaten Zimbabwe and DR Congo in their opening two group games.
The seven-time winners are also yet to concede a goal at this year’s Afcon, but they rode their luck against Uganda, who were left to rue a string of missed chances.
However, Salah did spurn an opportunity to score a third for Egypt when he was denied by a fine one-handed save by Denis Onyango when through on goal.
Egypt talisman Salah was criticised earlier this week for supporting team-mate Amr Warda, whose suspension was reduced by the Egyptian Football Association to the end of the group stage, meaning he is available for the Pharaohs’ next game.
Uganda will play either Kenya or Senegal in the round of 16.