Madagascar reached the Africa Cup of Nations for the first time in their history after beating Equatorial Guinea 1-0 on Tuesday at home. Thailand-based striker Njiva Rakotoharimalala became a national hero after netting the winner in the 42nd minute to secure his country a spot in next's year Cameroon's edition with two match days to spare. The Malagasy are top of their Group A with 10 points, three ahead of second-placed Senegal, who face Sudan, which has yet to gain any point out of this group, later in the day. Equatorial Guinea are third with three points and can only dream of a miracle to qualify for next summer's tournament. Madagascar – 106th in the FIFA monthly ranking of October – had a fairytale campaign, beating Sudan 1-0 in Om Durman, producing a great fightback to come twice from behind to hold Senegal to a 2-2 draw in Antananarivo before beating Equatorial Guinea in a double header 1-0 and 1-0. The architect of this success is Nicolas Dupuis, a 50-year-old French tactician who had never had a taste of glory or top flight football. He has been working with Madagascar since March 2016, first as an advisor then officially the team's manager starting from March 2017. He relies more on the foreign-based players, especially the team's top scorer Faneva Andriastsima, who plays for France second division side Le Havre and scored three goals during the qualifiers, and inspirational playmaker Paulin Voavy, who plays for the Egyptian Premier League side Maqassa. Dupuis said in an interview with France Football in March that he is hoping to convince more foreign-based players to play for the national team. Now that Madagascar has qualified for Africa's elite, the opportunity will be tempting for some to launch their international career. (For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)