A late Felix Badenhorst header was the difference as Madagascar lost 1-0 to Swaziland in their final Group A, 2016 COSAFA Castle Cup match on Wednesday evening at the Independence Stadium.
The loss means Auguste Fauxe's charges are out of the regional tournament after finishing as number three with four points behind Zimbabwe who thrashed Seychelles 5-0 to finish with five points
In the 11th minute Isihlangu Semnikati had a chance to score, but Badenhorst saw his shot dealt with by Franscois Randrianmonejanahary.
In the 27th minute, Badenhorst made a good turn on the edge of the box, but saw his attempt hit the crossbar.
Towards the 40th minute-mark, Wonder Nhleko failed to capitalise when the Malagasy fell asleep and he blasted his shot wide of goal from a great position.
It was 0-0 at the interval.
Harries Bulunga's men finally broke the deadlock with 18 minutes remaining when Badenhorst headed home following a set piece by skipper Tony Tsabedze, 1-0.
Four minutes later, Nhleko broke free on the right flank and took a grass cutting shot but Andriamfehy managed to pull off a save with his left foot.
In the final five minutes of the match, Swaziland kept the Barea under pressure and Tsabedze came close to doubling the lead, but his effort sailed wide.
The Swazi side are now leading the group with seven points and have ensured they set up a date in the quarter-finals against Chipolopolo of Zambia on Sunday.
Madagascar: (0) 0
Swaziland: (0) 1 (Badenhorst 72')