Tunisia beat Togo 2-0 in Tunis to qualify for the Africa Cup of Nations - but only after Malawi were denied by a last-minute equaliser.
With a minute left in N'Djamena, the Flames were going through but Chad's last-gasp strike dashed their hopes.
The Carthage Eagles thus took second spot in Group K, the only pool to have two guaranteed qualifiers thanks to having five teams.
Botswana wrapped up the first qualification from the group in March.
Tunisia, the 2004 African champions, opened the scoring through Walid Hicheri in the first half with Saber Khelifa wrapping up the win 11 minutes from time.
Togo were reduced to ten men after 76 minutes when Komlan Togoba was dismissed.
Botswana tallied 17 points from Group K and were followed by Tunisia (14) and Malawi (12).
Togo and Chad brought up the rear, with neither side managing to reach a double-figures points tally.