After a goalless first-half, it was Brahim Diaz to break the deadlock with a calm finish on 55 minutes before second-half substitute Ayoub El Kaabi netted a sensational bicycle kick on 74 minutes to seal all three points.
After a nervy opener from both sides in heavy rain, it was the hosts and tournament hopefuls who settled quickest on the ball under the watchful eye of head coach Walid Regragui.
Anass Salah-Eddine was looking lively on the left flank, while a good cross from Noussair Mazraoui from the right-hand side was just too high for the onrushing Soufiane Rahimi in the centre of the Comoros goal as Morocco signalled their attacking intent.
Next was a chance for Sofyan Amrabat to get a shot away as the ball broke to him from a loose defensive touch, but Comoros recovered with Kenan Toibibou making a crucial block.
Morocco were then handed a chance to make a fast start to this opener when the referee pointed to the spot after a rash tackle from Iyad Mohamed on Brahim Diaz but Rahimi smashed his spot-kick straight at Comoros goalkeeper Yannick Pandor.
There was another early blow for Morocco as an injured Romain Saiss was forced to make way for Jawad El Yamiq after just 18 minutes.
Morocco remained camped on the edge of Comoros' big box around the 20 minute mark but were unable to find a way through their opponent's defence.
The pressure was, however, relentless and were soon able to carve out a chance on the 26 minute mark as a super floated cross from the left was headed clear under pressure from Rahimi.
El Yamiq was then unsuccessful with a shot from range, as Azzedine Ounahi failed to beat the wall with his 28th minute free-kick.
Regragui was seen throwing his hands in the air after another wasted effort, this time from Saibari, whose wild effort was always going wide, after a quickly taken set-piece.
Comoros were struggling to get hold of the ball and possession was given away almost immediately but they were working well to contain their more illustrious opponents in defence.
Morocco were awarded a set-piece in a promising position on 37 minutes, but Nayef Aguerd fired his effort wildy into the stands.
Regragui's charges continued to probe with plenty of menace but no end product, while there was a second shout for a penalty. Diaz went down in the box and the foul ultimately went to a VAR check but a free-kick was awarded to Comoros for a hand-ball from the Morocco attacker.
There was a rare shot on goal for Comoros as Rafiki Said tested veteran Morocco goalkeeper Yassine Bounou with a late free-kick from range, while Stefano Cusin's almost contrived to hand Morocco the opener late in stoppage time with a sloppy back pass from Yannis Kari but Pandor was quickly out to clear the danger.
Morocco dominated every aspect of the first half but they started the second half on level terms with Comoros, who were looking for another monumental half of defending to get anything out of this tie.
The rain certainly had an impact on this tie but Morocco started to flex their credentials.
A great delivery from Saleh-Eddine was whipped into the near post on the left-hand side of the pitch, but despite making contact, El Aynaoui was unable to steer his touch on target.
Pandor then had to scramble to keep out a far-post Amrabat delivery, although play was ultimately called up for offsides against Saibari.
The Comoros keeper then got to the ball just ahead of an advanced Amrabat as Aynaoui failed to connect to a good cross at the back post from a good Mazraoui delivery.
But it was only a matter of time before Morocco found the back of the net, and ten minutes into the second half, the deadlock was broken as Diaz slotted home from close range after a great turn and cross from Mazraoui.
Rafiki Said had Morocco's fans hearts in their mouths when he stole the ball and ran free on goal, but he couldn't beat Bounou with his shot from the edge of the six-yard area.
A double save from Pandor kept Comoros in the tie on 64 minutes as he first expertly palmed a powerful Mazraoui shot before getting up quickly to deny El-Aynaoui on the rebound.
Bounou had to be alert to a powerful dipping shot from Youssouf M'Changama that flew just over the goal while Pandor got down well to deny Diaz a second with his shot from a wide position with 20 minutes of the match remaining.
But the Comoros goalkeeper could do nothing to stop El Kaabi from adding a second goal as he amazingly connected to a Salah-Eddine delivery to smash home a bicycle kick - having only been on the field for nine minutes.
Despite being two-goals down, Comoros refused to give up and threatened the Morocco defence with 10 minutes of the match remaining as M'Changama delivered in a teasing cross that needed a good headed clearance from Amrabat.
Morocco may well have had a third late on but Pandor was equal to a fizzing shot from substitute Youssef En Nesyri.
El Kaabi continued to look lively but was off balance as he looked to connect to a cross from Mazraoui while El Yamiq was off target with his chance as the ball dropped to him at the farpost.
Ultimately it was a strong start for Morocco who were not at their best in front of goal, but will take a lot of confidence heading into their second Group A game against Mali on Monday.
Comoros though can take heart from their performance and will be looking for a result when they take on Zambia on Friday.