The game was played at breakneck speed from kick-off at Stade Geoffroy-Guichard, but neither team was able to register a shot on target in the opening 30 minutes, with captain Nicolas Otamendi - one of Argentina’s three overage players - perhaps having the best chance during that period when he headed wide from Thiago Almada’s floated free-kick.
Hearts were in Moroccan mouths not too long afterwards as goalkeeper Munir Mohamedi almost gave the ball away when playing out from the back, before at the other end, the lively Ilias Akhomach forced Geronimo Rulli to punch clear.
The deadlock was broken on the stroke of half-time though, and it was Akhomach who played a key role in the goal as his outrageous backheel released Bilal El Khannouss, whose low cross was turned home smartly by Soufiane Rahimi, despite Rulli diving at his feet.
Soon after the break, former Barcelona winger Akhomach was the architect of Morocco’s second goal, running Otamendi ragged before being pushed over by Julio Soler, with Rahimi stepping up to score the resulting penalty confidently and double his tally for the afternoon.
Argentina head coach Javier Mascherano quickly acted to try and influence proceedings, introducing Giuliano Simeone, son of Diego, as Kevin Zenon was withdrawn, while Mascherano’s opposite number Tarik Sektioui chose to take off Akhomach, with Abde Ezzalzouli coming on in his place.
Ezzalzouli very quickly got into his stride, bursting down the right before squaring for Rahimi, who rather disappointingly wasted an opportunity to bag a memorable hat-trick.
That tame effort looked like it would prove costly, as Soler made amends for his earlier penalty concession with an inviting driven cross that was converted by Simeone at the back post, setting up a pulsating finale.
Munir denied Julian Alvarez late on in normal time before an astonishing 15 minutes of added time were signalled at the end of a bad-tempered second half.
However, after looking like they’d weathered the storm, the Atlas Lions saw their dreams of a historic victory seemingly shattered at the death when Cristian Medina nodded in from virtually on the goalline after Argentina had hit the bar twice in the build-up to the goal.
In the aftermath of that moment, several Morocco fans entered the field in protest as they felt the equaliser should have been disallowed for a foul.
As a result of the disorder, the match was delayed, with the last moments of the game contested a couple of hours later behind closed doors after referee Glenn Nyberg had confirmed that Medina’s effort wouldn’t stand as he had been offside.
Argentina - two-time winners of the Olympic men’s football tournament - will have to pick themselves up as they take on Iraq on Saturday, while Morocco face Ukraine later that day.
Flashscore Man of the Match: Ilias Akhomach (Morocco)