There were seven second-leg play-off ties for the 2013 Africa Cup of Nations on Saturday.
Zambia, Ghana, Mali, Nigeria, Tunisia and Morocco all qualified for next year's tournament in South Africa, but the tie between Senegal and Ivory Coast tie was abandoned after a riot inside the stadium.
Zambia win 9-8 on penalties.
Reigning African champions Zambia scraped through to South Africa after a dramatic penalty shoot-out.
Uganda were left heartbroken after dominating the game but failing to complete the task when Patrick Ochan missed the decisive spot-kick in sudden death.
Geoffrey Massa scored for Uganda on 27 minutes to level the aggregate score and the Cranes dictated the play with Tony Mawejje, Hassan Wasswa and Joseph Kizito all in impressive form.
But Uganda could not find a way through for a winner as Zambia keeper Kennedy Mweene produced a series of saves to keep his side in the tie.
The match went straight to penalties after 90 minutes and the omens looked good for Uganda when Zambia captain Chris Katongo missed the first kick.
But Uganda missed their second effort and penalties went into sudden death. And it was the unfortunate Ochan who missed his kick, ending Uganda's hopes of reaching the finals for the first time since 1978.
Ivory Coast led the match 2-0 - and the tie 6-2 on aggregate - after 76 minutes of their second-leg at the Stade Leopold Senghor.
However, with fires having been lit inside one stand and objects hurled on to the pitch play was temporarily suspended and the play-off eventually abandoned.
Earlier Didier Drogba had scored twice to put the Elephants in a commanding position. The first came from a free-kick and the second from a penalty - his 57th and 58th goals for his country.
A fan invaded the pitch before Drogba's spot kick and was stopped, and after the striker scored the fires started and the Senegalese Press Agency reported one of the match officials was hit by a projectile.
Ghana became the first team to qualify for the finals, progressing comfortably with a 1-0 victory in Lilongwe giving them a 3-0 win on aggregate.
Afriyie Acquah fired home the winner for the Black Stars after just three minutes, from a corner.
The four-time Nations Cup winners put in an efficient display, with the only scare coming when star striker Asamoah Gyan hit the floor in the second half dramatically, but he appeared to shake off the knock afterwards.
Malawi had their chances, but the hosts could not find a way back into the tie after conceding the early goal.
Mali booked their place in the finals, with a convincing 4-1 away win over Botswana giving them a resounding 7-1 aggregate victory.
Goals from Cheikh Tidiane Diabate, Modibo Maiga, Mahamadou Samassa and Abdou Traore secured an eight continental finals appearance for the Eagles.
The match marked the re-opening of the refurbished stadium in Lobatse but there was little for the Botswana fans to celebrate until a consolation goal in stoppage time at the end of the game from Mmusa Ohilwe.
Mali progress to South Africa hoping to improve upon a third-place finish in Equatorial Guinea and Gabon.
Nigeria were held by Liberia in the opening leg but they made light work of brushing aside the Lone Stars to qualify for next years final in South Africa.
Efe Ambrose struck in the first minute to set the Super Eagles on their way and Ahmed Musa doubled his side's lead before the break after latching on to Emmanuel Emenike's pass.
Three of the goals came from players at English Premier Leaguse side Chelsea, with Victor Moses scoring twice and Jon Obi Mikel also on the scoresheet after he struck from the penalty spot.
Ike Uche also found the scoresheet for Stephen Keshi's team, while Patrick Wleh scored a consolation for the away side, who had captain Gebro Duncan sent off.
A goalless draw in Monastir was enough to see Tunisia secure their qualification on the away goals rule.
The Leone Stars hopes of progressing were not aided by the dismissal of Djibril Sanko, who saw red for a poor challenge on Tunisia's Hamdi Harbaoui.
It was the major incident of a game that saw precious few chances and it was no surprise when the game ended goalless.
In the final play-off tie to finish on Saturday Morocco completed a stunning comeback to seal their place in next year's finals.
Mozambique frustrated their opponents throughout the opening phase but Abdelaziz Barrada scored for the Atlas Lions just before the break.
Houssine Kharja then levelled the tie on aggregate with a penalty - and Miro saw red for the foul that led to the spot kick.
Youssef Al Arabi then put Morocco in front for the first time before Nordin Amrabat completed an incredible comeback.