Ghana, Cameroon, South Africa and Senegal go through
Ghana, Cameroon, South Africa and Senegal are through to the finals of the All Africa Games after the weekend's last qualifying games.
Ghana overturned a 3-1 deficit to beat their rivals Nigeria 2-0 in Kumasi on Sunday and go through on away goals.
Cameroon beat DR Congo 3-1 on aggregate after a 3-0 home win in Yaounde.
South Africa were beaten 1-0 by Zimbabwe but still progress and Senegal went through on penalties against Guinea after their tie ended 1-1.
Ghana's dramatic victory came thanks to goals from Emmanuel Agyemang-Badu and Richard Mpong.
Agyemang-Badu scored with a fine free-kick in the first half, while Mpong slotted home a Dominic Adiyah pass from six yards in the 70th minute.
Ghana's captain Samuel Inkoom had promised they would turn the tide against Nigeria after the first leg.
Zimbabwe's 1-0 win over South Africa in Harare was not enough for them to overturn the tie, having lost the first leg 2-0.
Archford Gutu scored for Zimbabwe in the 47th minute through a header but they still go out.
Defending champions Cameroon went through after beating DR Congo 3-0 in Yaounde, to overtun a 1-0 first leg deficit.
Patrick Kamgang opened the scoring for the home side in the 30th minute following a goalmouth melee.
A similar situation eight minutes later enabled Djika Hagues to add a second.
Hagues scored the third early in the second half to send the Indomitable Cubs through 3-1 on aggragate after their 1-0 defeat in the first leg.
Cameroon defender Abednegoh Kembeng Azonga told BBC Sport they had to win to make a difference to football in the country.
''We failed to qualify for the Olympics, therefore we could not allow All Africa Games to go that way too,'' he said.
Senegal beat Guinea in Dakar 1-0 thanks to a late first half penalty scored by Mamadou Thiamm which levelled the tie at one apiece.
Qualification was decided on a penalty shoot-out, which Senegal won 5-4.
Uganda had already sealed their place after Kenya withdrew from the return leg of their fixture.
Hosts Mozambique, Egypt and Madagascar had already qualified for the 10th edition of the Pan- African games to be held in Maputo from September 3-18.
The draw for the tournament will be held in Cairo on 12 July.