Cristian Medina scored the equaliser in the 16th added minute as Argentina came from two down to draw 2-2 with Morocco on the opening day of men's Olympic football action on Wednesday, while Spain edged Uzbekistan 2-1.
Argentina are looking to win men's football gold in Paris for the third time after previous successes in 2004 and 2008, but Javier Mascherano's side looked set to get off to a losing start in Saint-Etienne.
They trailed 2-0 in the Group B game to a Soufiane Rahimi brace for Morocco but did pull one back through Giuliano Simeone before Medina finished off a crazy move right at the death.
Morocco captain Achraf Hakimi, the Paris Saint-Germain full-back who is one of the biggest names featuring in the tournament, set up forward Rahimi for the opener at the end of a fine move in first-half stoppage time.
The reigning African Under-23 champions doubled their lead six minutes into the second half from the penalty spot, UAE-based forward Rahimi stroking in the spot-kick after Ilias Akhomach was brought down.
Argentina coach Mascherano, who starred in the teams that won gold in Athens and Beijing, had at one point hoped to persuade Lionel Messi to feature among the three permitted overage players in his squad otherwise limited to those under 23.
Messi opted not to come to the Games, and the biggest names in their side here were Manchester City striker Julian Alvarez and captain Nicolas Otamendi, the Benfica defender.
Simeone, son of former Argentina star Diego, came off the bench to pull one back midway through the second half, and Medina saved a point in the 106th minute.
Otamendi's shot was turned onto the bar by the goalkeeper and Bruno Amione headed the follow-up off the woodwork, but Medina was on hand to make it third time lucky and secure a draw.
Group B rivals Iraq and Ukraine meet later in Lyon.
Gomez makes amends
Silver medallists in Tokyo three years ago, Spain were made to work hard to beat Uzbekistan in their Group C opener at the Parc des Princes in Paris.
FIFA president Gianni Infantino was among the spectators watching a Spain side featuring two members of their Euro 2024-winning squad in Alex Baena of Villarreal and Barcelona's Fermin Lopez.
Spain went ahead just before the half-hour mark when Sergio Gomez's free-kick was helped on by Abel Ruiz to the back post where Marc Pubill turned the ball in.
However, Uzbekistan had chances and drew level from the penalty spot in first-half added time.
Pau Cubarsi was penalised for a foul in the box following a VAR review, and Uzbekistan captain Eldor Shomurodov, the Roma forward, converted the penalty.
Cubarsi, the 17-year-old Barcelona prodigy, had been booked early in the game and did not reappear for the second half.
Spain got a penalty of their own for a foul on Aimar Oroz, but Gomez's kick was saved by goalkeeper Abduvohid Nematov.
However, Gomez made up for that by grabbing what proved to be the winner just after the hour mark.
Juan Miranda cut the ball back from the byline for Gomez -- who has just joined Real Sociedad from Manchester City -- to fire in.
Spain are in Group C with Egypt and the Dominican Republic.
The pick of Wednesday's later games will see hosts France face the United States in Marseille in Group A, with Thierry Henry's team hoping to win a medal despite failing in their attempts to enrol the services of Kylian Mbappe.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)