Egypt failed to get the win they needed to reach the semi-finals of the African Olympic qualifiers as they lost 1-0 to the Ivory Coast.
In the other Group B game South Africa and Gabon battled to a 1-1 draw.
The results mean the semi-final spots will be decided by Saturday's final games, with all four teams still in contention.
Those games see Ivory Coast play Gabon in Tangiers while South Africa will take on Egypt in Marrakesh.
All eight nations at the tournament, which doubles as the first ever African Under-23 Championship, can still make the last four.
Egypt against the Ivory Coast started as a cagey affair with most of the play confined to midfield.
The first real chance came on the half-hour mark as Egypt's Shehab El Din drove in a fierce shot that Ivory Coast goalkeeper Ibrahim Kone had to tip over the bar.
The Ivorians then created two good chances of their own with both falling to Wakalibile Lago.
First Lago picked up a back heel from his one-two with Lacina Traore but his shot was straight at the keeper.
He was then through on goal just before the break but rushed his shot and put it well over the bar.
Ivory Coast goalkeeper Kone made another good save 10 minutes into the second-half blocking a toe-poke from Marwan Mohsen with his feet after diving the wrong way.
The Ivorians then threatened a goal themselves with a chance from Marc Mahan well saved.
The only goal of the game came in the 82nd minute, when Serge Deble's cross was not cleared and a little back heel from Lacina Traore fell to Moussa Kone who scored.
Group B rivals Gabon and South Africa played out a 1-1 draw in the earlier match.
The first real chance fell to South Africa's Thandano Ntshumayelo in the 13th minute but he was unable to make the best of a ball that bounced up at him and his flicked effort went wide.
Six minutes later, Gabon stopper Mikiela parried a cross into the path of Sameegh Doutie whose shot was deflected behind by a last-ditch block by Emmanuel Mba Ndong.
The South Africans then hit the post with a diving header from Phumelele Bhengu after a cross from Doutie was headed back across goal by Jabulani Shongwe.
The goal came five minutes before the break when a cross from Rodney Ramagalela deflected off Remy Ebanega over his Gabon team-mates and Mandla Masanogo scored with a diving header.
Gabon steadily applied the pressure in the second half, with Lengoualama heading home late on.
But the Gabonese were forced to waste time late on after Mikiela's dismissal left them desperately clinging on to their first point of the tournament.
Group A resumes on Friday when Nigeria take on Algeria, and hosts Morocco face Senegal.
The top three teams at the tournament qualify for next year's Olympics while the fourth placed side face a play-off against an Asian side.