Madagascar pulled off one of the great shocks of the Africa Cup of Nations finals when they upset Nigeria 2-0 on Sunday to finish top of Group B and advance to the knockout stages.
A horrific defensive mistake and a wicked deflection from a free kick allowed the Indian Ocean islanders, making their tournament debut, to finish unbeaten ahead of both Nigeria and Guinea in the standings.
Lalaina Nomenjanahary took advantage of sloppy defending by Leon Balogun to open the scoring in the 13th minute and Carolus Andriamahitsinoro netted the second eight minutes into the second half.
Nigeria, one of the five African teams at last year's World Cup, had won their opening two matches but looked flat and proved unable to respond after going behind in their third and face extensive soul searching after an embarrassing setback.
Nomenjanahary reacted quickly to intercept a pass backwards from John Ogu to Balogun, who inexplicably backed away from the ball on the edge of the Nigeria penalty box, almost inviting the Malagasy striker to steal it away.
The early goal injected some confidence into the Malagasy, a motley collection of players from the lower leagues in France as well as clubs in Belgium, Bulgaria and the United States, but they rode their luck towards the end of the first half as Nigeria sought an equaliser.
Ahmed Musa had the best chance for the Super Eagles, unmarked for a first-time finish at the back post in the 31st minute, but he took a touch, giving Madagascar goalkeeper Melvin Adrien the opportunity to storm down on him and put him off his shot.
Adrien might have conceded a penalty with his challenge but Nigeria's protests were waved away by referee Bakary Gassama.
Nigeria brought on Wilfred Ndidi to try to inspire a second-half comeback but he was culpable for the second goal.
First he gave away a free kick on the edge of the area and then, as he jumped in the wall, deflected the 53rd-minute effort from Andriamahitsinoro. The ball took a wicked loop off Ndidi's body before falling into the net.
Ndidi did try to make amends and had a good turn and shot saved soon afterwards but was unable to give his side the necessary spark.
Oghenekaro Etebo went wide with two free kicks and even the introduction of Alex Iwobi for the last 30 minutes did little to change the course of the game.
Madagascar, ranked 108th in world football, finished on seven points to six for second-placed Nigeria. Guinea's four points in third place should be enough to see them also advance to the last 16 but Burundi, in last place without any points, are eliminated.