FIVE years ago, Madagascar were ranked 195th in the world and, at the turn of the millennium they were such an insignificant entity that, after a home match against Cote d'Ivoire, the only bonus the team received was US$250 which their fans had raised from well-wishers.
At the draw for the 2019 AFCON qualifiers in Libreville, Gabon, on January 12, 2017, they were considered one of the six weakest teams - including South Sudan, Djibouti, Comoros, Sao Tome and Principe and Mauritius - they were thrown into Pot 5 and ordered to play in a preliminary round.
Only three teams, from those six, would make it into the group stages of the qualifiers and their journey, to book a place at this Nations Cup finals, started three months before the rest of the countries.
For Madagascar, who were ranked 46th in Africa, it meant a two-legged battle against Sao Tome and Principe, ranked one place below them, with the first leg at the Stadio Nacional 12 de Julho, a 6 500 capacity stadium on the shores of the Atlantic, on March 22, 2017.
The Indian Ocean islanders won that game 1-0 but didn't need to score, an own goal by Jordao Diago, making the difference before, four days later in Antananarivo, Madagascar won a five-goal thriller 3-2 for a 4-2 aggregate victory that swept them into the group stages of the qualifiers.
Now, two years down the line, they are writing the Cinderella tale of the 2019 AFCON finals, after booking their place in the quarter-finals of the tournament on Sunday following a penalty shootout win over the Democratic Republic of Congo in Alexandria.
Their latest victory over a heavyweight, following an impressive 2-0 win over three-time champions Nigeria in Group B, meant that all of the Group A teams - Egypt, Uganda, Zimbabwe and the DRC - have been swept aside before a ball has been kicked in the quarter-finals.
That the same Congolese side, which Madagascar stretched into extra-time after a 2-2 draw before winning via the lottery of a penalty shootout, had demolished the Warriors 4-0 in their last match, went a long way to confirm their win over the Super Eagles wasn't a fluke and they have made some giant strides in this game.
It never used to be like this for these Indian Ocean islanders.
"As sporting miracles go, this one is extraordinary given Madagascar's complete lack of sporting heritage," journalist Amy Lawrence, noted in The Guardian newspaper of the United Kingdom.
"Their story is an African version of Iceland but without the enormous bubble-covered training centres and highly-qualified coaches.
"Memories from a visit to see Madagascar play Ivory Coast in 2001 outline how unsophisticated football in the country traditionally was.
"The domestic league was so disorganised it was a mission to establish how many teams were involved in competition.
"The national team were based in dorms in a half-built hotel, stepping over electric cables and trying not to bother the painters on the way to their rooms, with roaming chickens clucking in what was supposed to be the reception.
"When the head of the supporters group handed the captain an envelope with two million Malagasy francs to share out (roughly £200 (about US$250), raised by folks who have little to spare) the players were so grateful they cheered.
"The impression was of a football-loving nation desperate for help, finance, support and infrastructure. Slowly, they have benefited from the money and expertise that has come their way as part of FIFA's projects promoting football in Africa.
"They have also improved because of the number of players who now earn a living in more organised football environments abroad, with the majority playing in France. The only home-based players are the third-choice goalkeeper and the sublimely named young striker Romario Baggio Rakotoarisoa."
And, if they provided the Warriors with lessons, in their game against the DRC, of how to play such a high-profile match without pressure and fear and with both discipline and the right spirit, they also taught them of the value of a wise investment into the Diaspora talent.
While the Warriors' attempts to woo some of their refined troops from Europe, who have links to their motherland, notably striker Macauley Bonne, have been frustrated by bureaucratic bottlenecks, with only Tendayi Darikwa and Alec Mudimu being recruited from the rich reserves of the British Brigade, the Malagasy have gone full throttle in that adventure.
Ironically, in the only game Mudimu missed here because of injury, the defence collapsed and conceded four against the DRC.
And, it appears, just like Cape Verde who went on a recruitment of many Portuguese professionals with links to the Atlantic Ocean island to rise from 114th in the world to number one in Africa in March 2016, the Indian Ocean islanders have found the right formula.
Such has been the dramatic reconstruction of their team that only three players, who took part in those two preliminary 2019 AFCON qualifying matches two years ago, remain part of this reconstructed Madagascar side.
They have gone finishing in a number of French lower division teams like second-tier clubs - Clermont Foot 63, Paris FC, Troyes, Reims and Grenoble, and some amateur clubs in the country that currently holds the World Cup, while also drawing from the French Indian Ocean island of Reunion, a Thai club, Samut Sakhon, Bulgarian side Ludogorets Razgrad and United States Major League Soccer team, Minnesota United.
Most of them are from the Malagasy Diaspora community and were not even considered when the preliminary round qualifiers were played.
Frenchman Nicolas Dupuis, a coach whose career had played out in France's amateur leagues, was brought in to guide them but, with the Madagascar national team without the financial resources needed to employ him full-time, he has held on to his other job at French Fourth Division outfit FC Fleury.
"Both teams are close to my heart. You have to organise things carefully to manage to do both," he revealed here. "But, working at both locations also inspires me.
"We're like one big family. I am very proud of my players."
Luck also favours the brave and no one knows what would have happened on Sunday had the referee awarded the Congolese a penalty, late in the game, when Yannick Bolaise was clearly brought down inside the box.
With a bit of time still to be played, it would have been a severe test for the Malagasy had that been given and the Congolese had equalised.
Instead, the equaliser was powered home on the 90th minute mark by giant defender Chancel Mbemba from a ball floated into the box from a corner by substitute Meschak Elia.
Of course, all that doesn't matter now because, just like what they have done throughout this tournament, the Malagasy AFCON debutantes, who are paying for their country, held their nerve to win the shootout.
"It does not repel poverty (doing well here) but it repels the worries," defender Pascal Razakanantenaina told The Guardian. "With this feat, we provided a little happiness to the Malagasy."
Their biggest cheerleader on Sunday was President Andry Rajoelina.