Madagascar are on the verge of making the last 16 in their first Africa Cup of Nations after Marco Ilaimaharitra scored to earn a 1-0 win over Burundi in Alexandria on Thursday.
The Indian Ocean islanders, ranked 108 in the world, can finish first, second or third in Group B depending on how they fare against leaders Nigeria this Sunday.
But whatever place they occupy in the final standings will almost certainly take them through as group winners and runners-up and the best four of the six third-place teams progress.
Nigeria have six points, Madagascar four, Guinea one and Burundi none after two series of mini-league matches in the Mediterranean city.
Belgium-based Ilaimaharitra rifled a free-kick into the net on 76 minutes at a time when Burundi were looking likelier winners after Madagascar dominated the opening half.
Saudi Arabia-based attacker Charles Andriamahitsinoro, who stood out on the pitch because of his height and dyed blond hair, starred for Madagascar in the first half.
His early free-kick from the touchline dipped dangerously as it floated into the box and goalkeeper Jonathan Nahimana did well to push it away at the expense of a corner.
The Malagasy then produced a shot soon after that forced a fine save from the Burundi goalkeeper in 28 degrees Celsius heat at the Alexandria Stadium.
Midway through the opening half, Andriamahitsinoro burst down the middle between two defenders, but a poor first touch robbed him of a scoring chance.
Then, it was the turn of Burundi winger Cedric Amissi to threaten as he was pipped by goalkeeper Melvin Adrien in a race for possession.
A fluffed attempt to clear the ball by Romain Metanire offered Amissi another chance, but he did not react quickly enough and the ball was cleared.
Adrien foiled Sadio Berahino, who plays for English second tier club Stoke City, as Burundi continued to create chances.
Andriamahitsinoro was unlucky just before halftime when his goal-bound header off a cross was cleared off the line by Gaël Duhayindavyi.
Set pieces have often not been well executed at this Cup of Nations and a Gael Bigirimana attempt to score from a medium-range went embarrassingly high over the bar.
Bigirimana did much better midway through the second half, forcing a great save from Adrien off another free-kick.
It was from yet another set-piece that Ilaimaharitra gave Madagascar the lead, steering the ball into the net from the edge of the box.
Later on Thursday, Algeria face Senegal and Kenya meet Tanzania in a Group C double-header at the 30 June Stadium in Cairo.