Hosts Morocco beat Namibia 2-0 in Casablanca to secure their place in the semi-finals of the African Nations Championship (CHAN), the tournament for locally-based players only.
Morocco totally dominated the game and created more chances but the Namibians never gave up and had the ball in the net only for the goal to be ruled out for an infringement.
Ayoub El Kaabi, with his sixth of the tournament, gave Morocco the lead after 37 minutes, latching onto a quickly taken free-kick from Walid El Karti.
Salaheddine Saidi headed in the second goal ten minutes after the break.
The Moroccans now play Congo-Brazzaville or Libya in the semi-finals – who meet in their quarter-final in Agadir on Sunday.
The first real chance of the match fell to Achraf Bencharki after eight minutes when he was set up by Ismail El Haddad, but he shot over the bar.
Morocco steadily took control and Loydt Kazapua was forced to palm away an effort which swirled towards him after 15 minutes.
The hosts were finding it hard to break down the Namibian defence and it took a moment of quick thinking from Walid El Karti to get past them.
He was alert when Morocco were awarded a free-kick, and – as the Namibians began organising themselves – El Karti passed the ball to El Kaabi who was left one-on-one with Kazapua and scored easily.
Namibia may well ask questions as to whether the ball was still moving and whether the free-kick was taken from the correct place.
The lead was doubled ten minutes after the break when Wydad Casablanca’s Salaheddine Saidi leapt highest to head home Bencharki’s corner.
Moments before, El Kaabi thought he had scored his seventh of the tournament as he got in behind the Namibian defence and flicked the ball past the keeper only for the ball to be cleared away for the corner that resulted in the goal.
Namibia refused to give up and managed to create chances of their own and indeed they had the ball in the net in the 69th minute.
Absalom Limbondi lofted a free-kick into the area and Itamunua Keimuine thought he had headed home only for the goal to be ruled out for an infringement.
Morocco did have chances to extend their lead with Bencharki shooting just wide after a good dribble in the Namibian area and then Mohammed Nahiri hitting the bar.