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.
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.