Morocco were on course for victory when Al Ain striker Soufiane Rahimi scored twice in a five-minute spell either side of half-time, before Giuliano Simeone halved the arrears for Argentina.
Cristian Medina appeared to have equalised deep into stoppage time, but crowd trouble caused referee Glenn Nyberg to take the teams off the pitch before a VAR review could take place.
It was ruled that Bruno Amione was offside in the build-up, and with the goal chalked off, the teams returned to play three further minutes in an empty stadium two hours later, Morocco holding on for a memorable win.
Morocco inched ahead two minutes into first-half stoppage time, Ilias Akhomach bamboozling the Argentina defence with a wonderful backheel that allowed Bilal El Khannouss to cross for Rahimi to tap home.
Within four minutes of the restart, Morocco had a chance to double their lead as the tricky Akhomach was pushed inside the area by Julio Soler. Rahimi stepped up to the spot and made no mistake, stroking his kick into the bottom-left corner.
Javier Mascherano's team dragged themselves back into the contest with 22 minutes to play, though, as Soler's cross-shot was prodded in by the stretching substitute Simeone.
It looked like Argentina had levelled 16 minutes into stoppage time as both Amione and Nicolas Otamendi struck the crossbar before Medina nodded home from almost on the goal line.
However, some spectators then threw cups, bottles and pyrotechnics at the celebrating Argentina players, causing the teams to leave the field for almost two hours as fans were told to leave the stadium.
With a VAR review ruling Amione was offside in the build-up to Medina's header, the game restarted at 2-1 to Morocco and the Atlas Lions clung on for a huge win.
Morocco looked set to open their Group B campaign with a memorable win when Al Ain striker Soufiane Rahimi scored twice in a five-minute spell either side of half-time.
However, substitute Giuliano Simeone halved the arrears for Javier Mascherano's men, who twice hit the woodwork before Medina nodded home with the final contribution to an incredible game.
Morocco inched ahead two minutes into first-half stoppage time, Ilias Akhomach bamboozling the Argentina defence with a wonderful backheel that allowed Bilal El Khannouss to cross for Rahimi to tap home.
Within four minutes of the restart, Morocco had a chance to double their lead as the tricky Akhomach was pushed inside the area by Julio Soler. Rahimi stepped up to the spot and made no mistake, stroking his kick into the bottom-left corner.
Mascherano's team dragged themselves back into the contest with 22 minutes to play, though, as Soler's cross-shot was prodded in by the stretching substitute Simeone.
The Albiceleste struggled to carve out clear-cut chances to equalise, but Medina saved the day in dramatic circumstances with 116 minutes on the clock.
Munir Mohamedi spilled Thiago Almada's long-range shot then tipped Bruno Amione's follow-up onto the woodwork. Nicolas Otamendi then looped his header against the crossbar but Argentina made sure at the fourth attempt as Medina nodded into an unguarded net.
Data Debrief: Albiceleste leave it late
Medina's leveller was officially timed at 105 minutes and 24 seconds, the lengthy period of stoppage time a result of several heavy challenges and a number of supporters encroaching on the playing field throughout the match.
Few could argue they did not deserve their point, though, having ended the game with a tally of 2.41 expected goals (xG) to Morocco's 1.46.
Argentina looked to have salvaged a 2-2 draw from 2-0 down in Saint-Etienne, with Soufiane Rahimi netting twice before Giuliano Simeone pulled one back for La Albiceleste.
Medina appeared to have equalised when he nodded home following a goalmouth scramble 16 minutes into second-half stoppage time, but crowd trouble then broke out with cups, bottles and pyrotechnics being thrown at Argentina's players by spectators.
The referee took the teams off the pitch, and amid confusion over whether the final whistle had sounded, it was reported another three minutes would be played in an empty stadium.
It was subsequently announced Argentina's potential leveller had been ruled out after a VAR review showed Bruno Amione was offside in the build-up.
Another three minutes of stoppage time were then played out around two hours after the players had been taken off, with Morocco holding on to win 2-1.
While Morocco now sit top of Group B with three points, Javier Mascherano's side – who were among the pre-tournament favourites – remain on zero.