As qualifying concluded the Nigerians were held to a 2-2 draw by already qualified South Africa on home turf in Uyo to finish out of contention in third in Group A.
Congo, 1-0 winners over Sudan, secured the runners-up berth, and their finals ticket.
The last spot was grabbed by the Democratic Republic of Congo as best third-placed side.
Already assured their place beofre the last throw of the qualifying dice were Algeria, Burkina Faso, Cameroon, Cape Verde Islands, Congo Brazzaville, Gabon, Senegal, South Africa, Tunisia and Zambia.
Equatorial Guinea automatically compete as hosts.
The shock absentees from that list are the continent’s most populous nation, Nigeria.
Tokelo Rantie gave South Africa the lead against Stephen Keshi’s Super Eagles in the 42nd minute, when he sped past Azubuike Egwuekwe from the left flank before he fired past goalkeeper Vincent Enyeama.
Rantie scored his second goal in the 48th minute, when he sliced through the entire Nigeria defence before slotting home.
Nigeria pulled a goal back in the 68th minute through Sone Aluko after a rebound from a shot by Ike Uche which crashed against the post.
The Hull City winger then drew the home team level in stoppage time, but it was too little, too late for the outgoing champions.
South Africa were reduced to 10 men when Reneilwe Letsholoyane was sent off in the 72nd minute.
Qualifying for the continental showcase has gone ahead in the shadow of the current outbreak of the deadly Ebola epidemic which has killed more than 5,000 people and which first struck in Guinea at the start of the year.
It has since claimed almost 1,200 lives in the west African state, infecting around 1,900 Guineans.
Nations Cup organisers CAF have forced Guinea to play their home matches in Morocco, who ironically were last week stripped of the 2015 staging rights after insisting on a postponement because of fears of the spread of the virus.
As a consequence Guinea on Wednesday faced Uganda in the Moroccan port city of Casablanca, winning 2-0.
French-born Guinean Ibrahima Traore put his country in front with a 23rd minute strike. Soumah Seydouba added the second from the penalty spot in the 62nd minute after skipper Andrew Mesigwa was sent off three minutes earlier.
Ghana won Group E with 11 points after a 3-1 home win over Togo.
Guinea finished second on 10 points to ensure their place at the finals now hosted by Equatorial Guinea who earlier in the day announced they had recruited 50 Cuban doctors to help fight Ebola.
Abdulmajeed Waris gave Ghana’s Black Stars a 24th minute lead, with Celtic midfielder Mubarak Wakaso doubling their advantage four minutes later with a rasping shot from outside the box.
Togo pulled a goal back in the 47th minute through Jonathan Ayite but Udinese midfielder Emmanuel Agyemang Badu made the game safe for Ghana in the 68th minute.
Ivory Coast drew 0-0 with Cameroon at home to finish second in Group D on 10 points from six matches and also advance to the tournament. Cameroon won the group on 14 points.
Cameroon were reduced to 10 men in the 57th minute when skipper Stephane Mbia was sent off for a foul on goal-bound Gervinho at the edge of the box.
Mali joined Algeria at the finals with a 2-0 home win over the north Africans after closest rivals Malawi were held to a goalless draw in Ethiopia.
Mali veteran star Seydou Keita tucked away a penalty in the 29th minute and then Mustapha Yatabare put the game to bed in the 52nd minute.
Mali ended qualifying on nine points, Malawi recorded seven points and Ethiopia bottom with four points.
Zambia edged Group F winners Cape Verde 1-0 courtesy of Kampamba Chintu’s 78th minute strike.
Zambia finished on 11 points, one point behind Cape Verde, while Mozambique and Niger drew 1-1 in Niamey.
Mozambique finished with six points and Niger bagged three points in Group F.
DR Congo beat Sierra Leone 3-1 to finish as the best third placed team with nine points, edging former multiple champions Egypt who finished on six points after a 2-1 loss in Tunisia.
The Africa Cup of Nations takes place in Equatorial Guinea from January 17-February 8, with the draw on December 3- AFP