Morocco advanced to the last 16 of the Africa Cup of Nations with a 2-0 victory over Comoros in Group C.
Selim Amallah fired in a loose ball to open the scoring, and Zakaria Aboukhlal slotted in to complete the win for the Atlas Lions in the last minute.
They will be far from satisfied with a wasteful performance which included a missed penalty by Youssef En-Nesyri.
Comoros keeper Salim Ben Boina put in a hugely impressive display but could not prevent a defeat for the debutants.
Morocco have maximum points from their opening two games but were sloppy in front of goal - to the obvious frustration of coach Vahid Halilhodzic on the touchline.
Atlas Lions profligate in front of goal
The North Africans deserved their lead through a well-taken goal from Standard Liege midfielder Amallah in a crowded box and should have doubled their advantage before half-time.
Nayef Aguerd was unlucky to see his towering header from a corner cannon off the underside of the crossbar before the ball was scrambled away.
In the second half they continued to dominate possession and created opportunity after opportunity, but were still unable to capitalise.
Ayoub El Kaabi, substitute En-Nesyri, Amallah and others all wasted chances in front of goal, while Boina came into his own in the latter stages of the game.
He denied Morocco three times in one goalmouth scramble when the Atlas Lions seemed certain to score.
Ten minutes before time the Coelacanths keeper brought down Aboukhlal, but he saved the subsequent penalty and blocked several other chances as the minutes ticked away.
Boina was finally beaten for the second time when Aboukhlal turned and shot in the 90th minute to give Morocco a more respectable winning scoreline.
Comoros created the occasional chance and fully contributed to an entertaining game but were outclassed, at least in terms of possession and passing, and their wait for a first goal and first point at their maiden Nations Cup finals goes on.
The islanders' final chance in Cameroon is on Tuesday evening against Ghana in Garoua (19:00 GMT).
Morocco, meanwhile, remain in Yaounde for their last group game against Gabon, whilst the Atlas Lions already have their eyes on the next round of the competition.
- 2HakimiBooked at 42mins
- 4S Amrabat
- 28TissoudaliSubstituted forFajrat 65'minutes
- 15AmallahBooked at 41minsSubstituted forOunahiat 90'minutes
- 7LouzaSubstituted forAboukhlalat 65'minutes
- 17BoufalSubstituted forEl-Haddadiat 76'minutes
- 9El KaabiSubstituted forEn-Nesyriat 65'minutes
- 1Ben Boina
- 19YoussoufSubstituted forMogniat 89'minutes
- 15YoussoufSubstituted forZaharyat 65'minutes
- 13AbdullahSubstituted forBourhaneat 59'minutes
- 22BakariSubstituted forYoussoufat 90'minutes
- 10M'ChangamaBooked at 18mins
- 8BachirouSubstituted forMoussaat 90'minutes
- 7SelemaniBooked at 16mins
- 21Ben Nabouhane
- 5Ali Mohamed
Match ends, Morocco 2, Comoros 0.
Second Half ends, Morocco 2, Comoros 0.
Offside, Morocco. Youssef En-Nesyri tries a through ball, but Munir El-Haddadi is caught offside.
Foul by Youssef En-Nesyri (Morocco).
Younn Zahary (Comoros) wins a free kick in the defensive half.
Attempt saved. Zakaria Aboukhlal (Morocco) left footed shot from the centre of the box is saved in the centre of the goal. Assisted by Munir El-Haddadi with a cross.
Foul by Azzedine Ounahi (Morocco).
Youssouf M'Changama (Comoros) wins a free kick in the defensive half.
VAR Decision: Goal Morocco 2-0 Comoros (Zakaria Aboukhlal).
Substitution, Comoros. Ibroihim Youssouf replaces Saïd Bakari.
Substitution, Morocco. Azzedine Ounahi replaces Selim Amallah.
Substitution, Comoros. Djoumoi Moussa replaces Fouad Bachirou.
Substitution, Comoros. Ahmed Mogni replaces Mohamed Youssouf.
Goal! Morocco 2, Comoros 0. Zakaria Aboukhlal (Morocco) right footed shot from the centre of the box to the bottom right corner. Assisted by Selim Amallah.Goal awarded following VAR Review.
Zakaria Aboukhlal (Morocco) wins a free kick in the defensive half.
Foul by Nadjim Abdou (Comoros).
Attempt saved. Zakaria Aboukhlal (Morocco) left footed shot from the right side of the box is saved in the bottom right corner. Assisted by Achraf Hakimi.
Foul by Sofyan Amrabat (Morocco).
Youssouf M'Changama (Comoros) wins a free kick in the attacking half.
Penalty saved! Youssef En-Nesyri (Morocco) fails to capitalise on this great opportunity, left footed shot saved in the centre of the goal.