The Hippos sealed their place in the last eight after finishing second in Group A behind leaders Cameroon.
They will now play the Burkina Faso who finished top of Group B.
The East Africans started their campaign with a 2-0 win over Mozambique.
Derrick Kakooza and Steven Sserwadda scored the goals for the Morley Byekwaso-led charges.
In their second game, the U20 Cecafa champions fell to Cameroon by a solitary goal scored by Junior Jang.
Their final game was against the competition hosts Mauritania.
The hosts got an opener in the first half when Silly Sanghare scored from a penalty.
However, Uganda Hippos equalised on the hour mark courtesy of Steven Sserwadda’s strike.
Derrick Kakooza scored the winner for the East Africans deep into the second half to seal a place in the knockout stage.
Burkina Faso’s journey
Burkina Faso started their campaign with a stalemate against Tunisia before defeating the Central African Republic 3-1.
Their final game against Namibia ended 1-0 in their favour.
The two teams will now meet on February 26 with the winner sealing a semi-final berth.