Playing before thousands of fans that thronged the Mohammed V stadium in Casablanca, the Atlas lions found it tough breaking down the Mauritanian rear guard, ending the first half goalless.
But a second half blitz profited the hosts, as Ayun El Kaabi opened the scoring in the 65th minute after a neat through-ball set him on a mazy run, ending with a fine finish.
Minutes later, a fiery shot from outside the box by Ismail El Hadaad ended in the back of the net.
Ayun El Kaabi struck again in the 80th minute to end any chance of an unlikely Mauritanian come-back, and the rout was completed when Achraf Benchaki broke free on the right, took out keeper Souleimane Brahim to fire from a tight angle in the 92nd minute.
Victory for the hosts brought a cheerful end to a sad day for Moroccan football with former star Hamid Hazzaz dying of a heart attack aged 72 just hours before the tournament began.
Known as “The Spider“, Hazzaz was part of the Morocco 1970 World Cup squad and the team that won the Africa Cup of Nations for the only time six years later.
The powerful showing must surely leave the other teams in Group A Guinea and Sudan with plenty to think about.
A colourful opening ceremony preceded the first match and 14-year-old crown prince Moulay el Hassan got the tournament under way with a symbolic kick-off.
Staged every two years, the Nations Championship is restricted to home-based footballers and the Democratic Republic of Congo (twice), Tunisia and Libya won previous editions.