But Madagascar were once again disciplined, organised and enterprising, the undisputed sensation of their first Cup of Nations, but Tunisa deservedly advance to meet Senegal in the first of Sunday's semi-finals.
The early stages of the game were tight, with neither side so much as creating and opportunity to create an opportunity to score.
But gradually, Tunisia imposed themselves, pinning Madagascar inside their own half and playing with increasing menace in the quarter of an hour before the break.
When the players returned, Tunisia maintained momentum, and took the lead on 52 minutes when a fine move allowed Ferjani Sassi to shoot.
Aiming for the bottom corner, he found the corner of Thomas Fontaine's bottom, and the deflection was enough to take the ball past Melvin Adrien.
A clincher always looked more likely than an equaliser and on 59 minutes it arrived, Youcef Msakni flying forward to find Wahbi Khazri, whose shot was pushed back into Msakni's path; he coolly slotted home.
Still Madagascar could not threaten, and in the final minute of injury-time they fell further behind, wasting a corner and allowed Khazri to break; he found Naim Sliti, who clipped home a lovely finish.