Zambia were held to a 1-1 draw with Namibia but still finished top of Group B on goal difference at the African Nations Championship (CHAN) in Morocco.
Uganda and Ivory Coast ended their campaigns with a goalless draw, to earn their first points at the tournament for locally based players only.
Namibia took the lead through Absalom Limbondi but Lazarous Kambole levelled.
Zambia will face Sudan in the quarter-finals on Saturday, the same day Namibia take on Morocco.
Both Zambia and Namibia approached their match in Casablanca seemingly desperate to get the win that would ensure they avoided playing the tournament hosts in the last eight.
Namibia’s goal was a speculative free-kick from 40 yards by Limbondi that not only evaded his forwards but also the Zambian defence to land on the edge of the six-yard area and bounce into the top corner.
The equaliser came 11 minutes later, when Ernest Mbewe pulled the ball back from the byeline and Kambole managed to guide it home despite the fact he was off balance.
Both sides continued to create chances throughout the game but the defences held firm.
The stalemate in the other match meant Uganda finish third in the table, thanks to the goal they scored in their 3-1 loss to Zambia in the opening group game.
Ivory Coast finished bottom of the group with a single point as well, but having failed to score at the tournament.
In the first half both goalkeepers only had routine saves to make and in the second the Ivorians shot wide twice – Mamadou Diomande and Gbagnon Anicet Badie the players involved.
The best save of the game was made by Ivory Coast’s Abdoul Karim Cisse as he dived to save swerving shot from Uganda’s Ibrahim Sadam Juma.