Debutants, the Bereas of Madagascar stun the Super Eagles of Nigeria 2-0 in the last round of matches in group B.
A defensive error allowed Lalaina Nomenjanahara round Ikechukwu Ezenwa in goal for nigeria to slot the ball into an open net.
Despite pressing for an equalizer, Carolus Andriamahitsinoro took a spectacular free kick into the right top corner of the net.
Having drawn their first match against Guinea, defeat Burundi in their second match and defeated the Super Eagles, Madagascar won group B with seven points.
Nigeria finished second with six points, Guinea came third with four points while Burundi had no point.
Nigeria will take on the second placed team in group F in the round of 16, it could be the defending champions, Cameroon, Ghana, Benin Republic or Guinea Bissau.
In group A, Egypt emerged tops with nine points after they defeated the Cranes of Uganda 0-2. The Ugandans finished second while DR Congo came third with three points after they hammered the Warriors of Zimbabwe 2-0.