Teji Savanier was the last-gasp match winner as France staged a remarkable comeback to beat South Africa 4-3 in the Olympic football group stages.
After a goalless first half, Kobamelo Kodisang's goal put South Africa in front in the 53rd minute. Andre-Pierre Gignac, aged 35, levelled up with his first goal of the match four minutes later.
Evidence Makgopa put South Africa back in front but Gignac again equalised with 12 minutes remaining. Teboho Mokoena then put South Africa ahead for a third time in the 81st minute before Gignac converted from the penalty spot in the 86th to set the stage for Montpellier midfielder Savanier's late blast.
South Africa lost to hosts Japan 1-0 to open Group A on Thursday in their first group match, while France were routed by Mexico 4-1 in their opener.
Takefusa Kubo and Ritsu Doan scored in the opening 11 minutes to lead Japan to a 2-1 victory over Mexico.
Mexico had Yohan Vzquez sent off in the 67th but Roberto Alvarado still gave them hope of a comeback by scoring in the 86th minute. However, Japan held on to maintain their perfect record in Group A and move to within touching distance of the knockout stages.
Playing with 10 men for most of the game, Brazil held the Ivory Coast to a 0-0 draw in Group D.
The defending Olympic champions were at an early disadvantage early when Aston Villa midfielder Douglas Luiz was sent off in the 13th minute.
In the other game in Group D, centre-back Felix Uduokhai pounced on a late header as Germany edged out Saudi Arabia 3-2 in a Group D thriller in Yokohama, with both teams combining for 32 attempts on goal.
Germany twice threw away the lead and had a player sent off before Uduokhai struck late to hand his side a first win in Japan.
Victory means the Germans now have three points in Group D, a point behind both Brazil and Ivory Coast. Saudi Arabia are without a point and sit bottom of the group.
Elsewhere, Honduras picked up their first win of the tournament as Rigoberto Rigas' 87th-minute winner earned them victory over New Zealand in Group B, while Lee Kang-in scored twice after coming off the bench in the second half to lead South Korea to a 4-0 victory over 10-man Romania in the other game in the group.
South Korea's victory leaves all four teams with three points in Group B heading into the final round of games on Wednesday.
Lens defender Facundo Medina was the matchwinner for Argentina, scoring the only goal in their 1-0 win over Egypt in Group C.
"This victory is very good for us, especially in terms of spirits," said Argentine coach Fernando Batista. "We knew it was going to be a difficult match. Egypt had not lost for a long time. Now we have to rest and prepare for the best way to define the group against Spain."
Finally, Spain winger Mikel Oyarzabal ended his country's 21-year wait for an Olympic goal in a hard-fought 1-0 victory over Australia in Group C.