A freak goal from Khaled Korbi set up Tunisia to make an ideal start to their African Nations Cup campaign.
The midfielder's intended cross put the Tunisians ahead before half-time, and Youssef Msakni extended their lead in the Group C clash.
Houssine Kharja scored to make for a tense finish in Libreville, but Morocco could not find a leveller.
Tunisia beat Morocco in the 2004 final and again had the measure of their north African opponents.
They threatened first in the eighth minute when Nadir Lamyaghri had to tip away a shot from Karim Haggui.
Arsenal striker Marouane Chamakh had Morocco's first chance when he ran clear but sent his shot straight at Aymen Mathlouthi.
Tunisia then went close to a breakthrough in the 25th minute as Zouheir Dhaouadi cracked a left-footed shot from 25 yards against the left post.
They did go in front after 34 minutes after a free-kick was awarded on the left flank for a dangerous challenge on Dhaouadi by Mehdi Benatia.
Forty yards out from goal, Korbi floated the ball across and one bounce later it nestled in the bottom right corner. Saber Khelifa looked to be claiming a touch, but replays indicated the ball whistled over his head.
Tunisia could have gone 2-0 up but Lamyaghri raced 35 yards from his goal to intercept a through-ball to Khelifa.
Morocco brought Adel Taarabt on for the second half, having surprisingly started with the QPR playmaker on the bench.
Youssouf Hadji should have brought Morocco level in the 65th minute when he took down a long pass with supreme skill.
On his left foot, slightly to the right of goal, Hadji aimed for the far corner on the half-volley but curled his finish wide. It was a rushed effort and a costly one.
Tunisia doubled their lead in the 76th minute when a winding run from Youssef Msakni saw the substitute skip past Ahmed Kantari and Badr El Kaddouri before rifling a shot into the bottom left corner via the shins of Morocco defender Mehdi Benatia.
Kantari helped Morocco back into the game in the 86th minute when, from what seemed an offside position, he headed the ball down for Houssine Kharja to drive into the net.
Passions spilled over into some unnecessary jostling which led to a booking for Ammar Jemal.
Kharja, with some clever footwork, engineered an opening for himself in stoppage time, but his shot went a foot too high.