Whatever the outcome of this third-placed playoff, history was guaranteed to be made.
In pursuit of their first-ever medal in men’s Olympic football, Egypt flew out of the traps and created a gilt-edged opportunity when the unmarked Osama Faisal flew in at the far post, only to see his bullet header beaten away by the strong arm of Munir.
His save looked to be a defining moment midway through the first half as it gave his side the platform to take the lead. They did so in style too, as Abde Ezzalzouli worked himself a yard in the area and curled into the top right corner.
It was unusual to see a Morocco goal scored by someone other than golden boot-chasing Soufiane Rahimi, but just two minutes and 40 seconds later he’d got his name on the scoresheet, rising highest in the area to head home Ezzalzouli’s pinpoint delivery.
It was almost a case of damage limitation for the rest of the half for Egypt, who did at least manage to get through to half-time unscathed, although with their evident lack of attacking intent, mounting a comeback after the break always seemed unlikely.
Those faint chances of a miraculous turnaround were extinguished within 10 minutes of the restart - in fine fashion too - as a lung-busting run from Bilal El Khannouss ended with the Moroccan guiding a sumptuous effort into the bottom corner.
The Egyptians were now at risk of being embarrassed, but with Rahimi still chasing the golden boot, there was little chance of Morocco heeding their plea for mercy.
The striker already had a three-goal lead in that personal quest before he added his eighth goal of the tournament when he coolly slotted past Hamza Alaa.
With the golden boot essentially wrapped up by this stage, Rahimi turned provider for one of his teammates shortly after when his cross was turned home from close range by Ahmed Atef.
Morocco saved the best until last though, and it was their star man who produced the moment of magic too, as Achraf Hakimi’s 30-yard free-kick flew into the top corner to put a top hat on what will arguably go down as one of the best days in their Olympic football history.
Flashscore Man of the Match: Soufiane Rahimi (Morocco)