Mostafa Mohamed scored either side of the interval to give Egypt a 2-1 victory against Cameroon and secure the top of their Group A in the U23 Africa Cup of Nations.
Eric Ayuk scored Cameroon's goal but that was no consolation as Rigobert Song's men have been eliminated from the tournament after dropping to the third place just behind Ghana who have a better goal difference.
The Pharaohs have now accumulated a maximum of 9 points and will wait for their semi-final opponent as Group B is yet to be decided on Friday.
The top three teams in the tournament will qualify for next year's Olympic Games in Tokyo.
Despite of having already secured a last four berth, coach Shawki Gharib only made two changes to his lineup for this game as he brought in Abdel-Rahman Magdi and Emam Ashour for Salah Mohsen and Ammar Hamdi.
The Pharaohs dominated the game in the opening minutes until the 27th minute when Karim El Eraky's perfect low cross found Mostafa Mohamed who slot home from inside the six yards.
10 minutes later Eric Ayuk restored parity when he headed from inside the box a corner from Kevin Olivier.
After the interval, the hosts upped their game and Mohamed climbed highest above the Cameroonian defence to meet Ashour's cross with a header scoring his fourth goal of the tournament.
Cameroon attacked en masse and were dangerous on set pieces especially from specialist Franck Evina who once missed the target by a whisker then was unlucky to see his perfect curler crash off the post at the hour mark.
The young Indomitable Lions left acres of spaces at the back and Ramadan Sobhi and Ahmed Ramadan could have increased Egypt's tally of goals but they lacked the final touch.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)