Guinea and Mozambique have taken the last remaining places in the last round of 2010 World Cup and Africa Cup of Nations football qualifying.
Cameroon, Kenya, Benin, Nigeria, Ghana, Gabon, Algeria, Ivory Coast, Morocco, Rwanda, Tunisia, Burkina Faso, Mali, Sudan, Zambia, Togo, Malawi and Egypt are other 18 teams to go through.
Mozambique joined them after Angola came from behind to beat Niger 3-1 in Luanda. Uganda were set to go through as one of the best runners-up if Angola failed to win, but the result put the Cranes down into third position in the group.
Guinea held on to beat Kenya 3-2 in Conakry to finish top of Group Two.
The joint qualifying campaign will decide which five teams will join hosts South Africa at the tournament in 2010.
The qualification process will also decide the 15 teams who will join hosts Angola to take part at the 2010 Africa Cup of Nations.