Morocco beat Tanzania 3-1 in Group D of their African Cup of Nations qualifying campaign to seal top spot and the return to the finals of the tournament for the first time since 2008.
The day had begun with all four teams in with a chance of qualifying for the finals, but Arsenal striker Marouane Chamakh settled the nerves for the Atlas Lions with an early header before Tanzania picked up an equaliser before the break. QPR's Adel Taarabt then struck the decisive blow with a fine free-kick and Russian-based M'Bark Boussoufa's late strike sealed the win.
Also in Group D Algeria needed eight goals to qualify with Morocco losing, but beat Central African Republic 2-0 as Hassan Yebda struck in the opening stages from a corner. Foued Kadir poked home from close range, but qualification was always going to be tough for the Desert Foxes to complete and they were unable to net any other goals.
Ivory Coast finished with a 100% record as both Toure brothers scored in a 2-1 win at home over Burundi on Sunday.
Kolo Toure put the Ivory Coast ahead in the 77th minute, before Dugary Nolabashinze got a shock equaliser for Burundi. However the Elephants, who had already secured their place at the finals in Gabon and Equatorial Guinea next year, came away with all three points as Yaya Toure stole a late winner. They finished 12 points clear at the top of Group H.
In the same group, Rwanda finished on a high by beating Benin 1-0. With both teams already out of contention, the result mattered little in the qualifying equation but, with Ghanaian coach Sellas Tetteh under pressure ahead of the game, Mere Kagere's sixth minute strike restored some pride.
Senegal also dominated in Group E and defeated Mauritius 2-0 in Port Louis to finish with an unbeaten record.
Goals from Dame Ndoye and Papiss Cisse in the first-half were enough to see off the islanders and the game was all but over inside 25 minutes.
As a result of their record in the qualifiers, despite losing to Ghana on Saturday, Sudan join Libya at the finals as the best runners-up.
Teams who have qualified for the African Nations Cup: Gabon, Equatorial Guinea, Botswana, Ivory Coast, Burkina Faso*, Senegal, Ghana, Guinea, Zambia, Angola, Tunisia, Mali, Niger, Morocco. Libya and Sudan (best runners-up).
* Facing possible legal action over the alleged use of an unqualified player vs Namibia which could see them thrown out of the tournament.