Madagascar truly showed themselves to be the fairytale story of the competition beating Nigeria 2-0 to run out Group B winners.
The Barea impressed with a draw with Guinea and draw with Burundi, but superseded this with a tremendous performance and goals from Lalaina Nomenjanahary and Carolus Andriamahitsinoro.
Nigeria made five changes including starting John Obi Mikel ahead of Alex Iwobi. Having already qualified for the second round, you can understand the thinking from Gernot Rohr but his team couldn't be in worse shape heading out of the group stages.
The opener came after 13 minutes when Nomenjanahary nipped in front of Leon Balogun on the edge of the Nigeria box and calmly rounded Ikechukwu Enzenwa before slotting home.
It wasn't a game full of chances, but the Barea were the more purposeful whenever attacking and, after Ibrahim Amada was felled on the edge of the box, Carolus Andria's free kick deflected off Wilfred Ndidi giving Enzenwa no chance as it went in off the far post.
The result means Madagascar finish top of Group B with Nigeria second, while Guinea's 2-0 victory over Burundi,thanks to Mohamed Yattara's brace, has them third.
TALKING POINT Where does Madagascar's win rank in the pantheon of upsets in this competition?
The Barea are ranked 108th in the Fifa rankings between the Faroe Island and Zimbabwe, while Nigeria are 45th.
The Central African Republic's victory over Algeria in AFCON qualifying nine years and of course Zambia were rank outsiders when they won the competition in 2012, but this is certainly noteworthy.
MAN OF THE MATCH: Thomas Fontaine (Madagascar)
It could really have been a number of his team-mates but Fontaine's calm presence at the back ensured his team settled into the game and denied Nigeria clear openings to get back into the game.
- MADAGASCAR: Adrien 7, Metanire 7, Razakanantenaina 7, Fontaine 8, Mombris 7, Abel 7, Amada 8, Ilaimaharita 8, Nomenjanahary 7, Andriamahitsinoro 8, Andriatsima 7..subs - Gross 6, Randrianarisoa 6, Ravelson 6
- NIGERIA: Ezenwa 6; Awaziem 6, Troost-Ekong 6, Balogun 5, Aina 6, Ndidi 6, Etebo 5, Mikel 5, Musa 5, Ighalo 5, Kalu 6..subs - Ndidi 5, Iwobi 6, Simon 6
- 13' GOAL! Wow....Madagascar are in front. A horrendous error from Balogun trying to let the ball run across his body on the edge of the box and Nomenjanahary nips in front of him, calming rounds the keeper to put his side in front.
- 23' Just a great counter-attack from Madagascar. Mombris linking with Andriamahitsinoro before pulling back to the centre forward in the box but he cannot get a good connection on the ball.
- 30' The best chance yet for Nigeria to equalise. The ball breaks to Musa in the box and he rounds the keeper but Metanire is on hand to clear for a corner.
- 44' Slick football from Madagascar as Andriamahitsinoro plays a slide-rule pass to Andriatsima who rifles an effort just wide of the target.
- 50' A coming together in the box from Fontaine and Kalu would have had hearts in the mouth from the Madagascar fans. No penalty the right call but we've seen them given.
- 52' More sloppy play from Nigeria and Ndidi brings down Amada 20 yards from goal.
- 53' GOAL! 2-0. It wasn't the best free kick in the world from Andria but it got a huge deflection off Ndidi in the wall and curled perfectly into the far post and in.
- 57' Lovely turn in the box from Ndidi but his left-footed effort is straight at Adrien. Nigeria's first shot on target.
- 60' A corner is cleared back to Kalu and his cross is fisted away by Adrien and Ndidi just fails to get a shot away.
- FULL TIME - A great win for Madagascar and a day their sporting fans will never forget. Many questions for Nigeria to answer but let this day be all about the Barea who were tremendous. Their coach is given a dousing in water on the sidelines.
- The reverse is Nigeria's first defeat to African opposition in two years since South Africa defeated them in a qualifier for this compeition on their home soil.
- The Super Eagles were ranked 63 spots ahead of Madagascar in the Fifa Rankings prior to this game.