Twenty penalties
It took 20 penalty kicks before the Zambians edged Uganda 9-8 after they drew 1-1 on aggregate having lost the second leg of their final round qualifier 1-0 in Kampala.
Tunisia also scraped into the finals on away goals after being held 0-0 by modest Sierra Leone at home in Monastir, following a 2-2 draw in last month's first leg.
Morocco's Youssef Al Arabi scored five minutes from time, after earlier missing two gilt-edged chances, to give Morocco the decisive third goal in a 4-0 win over Mozambique in Marrakesh where they overcame a 2-0 first-leg deficit.
But the tie was clouded in controversy with the turnaround coming just after the hour mark when Morocco were awarded a soft penalty that led to Mozambique captain Miro being sent off.
Ghana were first to qualify by beating Malawi 1-0 away in Lilongwe for a 3-0 aggregate triumph thanks to Afriyie Acquah's debut goal. Mali went on the rampage with a 4-1 win over Botswana on the road in Lobatse to advance 7-1 on aggregate.
They were outdone by Nigeria, who thumped Liberia 6-1 in Calabar with the Chelsea pair Victor Moses (2) and John Obi Mikel (penalty) on the scoresheet. Nigeria scored inside a minute and swamped the visitors for an 8-3 aggregate triumph.
Eight second-leg ties will be played on Sunday to complete the 15 qualifiers for the Jan. 19 to Feb 10 tournament.