Defending Olympic champions Brazil beat Germany 4-2 in their opening Group D game in the men’s Olympic tournament at the International Stadium Yokohama in Japan on Thursday.
Meanwhile, Argentina suffered a shock 2-0 loss to Australia as the group stage kicked off on Thursday.
Brazil should have had the outcome decided by the interval given the number of chances they created but Germany struck twice in the second half, despite going down to 10 men in the 63rd minute.
Richarlison struck a stunning hat-trick inside 30 minutes. He drove home at the second attempt in the seventh minute and headed Brazil into a 2-0 lead before completing his hat-trick with a fine strike in the 30th minute with the German defence in chaos.
Nadiem Amiri pulled one back for Germany after the break and although Max Arnold was dismissed in the 63rd minute, a Ragnar Ache header gave Brazil unexpectedly nervous final stages.
But with Germany pushing forward, Brazil caught them on the break in stoppage time, Paulinho finishing off a counter-attack with a fine shot into the top corner.
In their first Olympic campaign since Beijing 2008, Australia took a surprise lead against twice gold medallists Argentina inside 14 minutes when winger Lachlan Wales scored from close range.
Argentina's problems were compounded late in the first half when left-back Francisco Ortega was sent off after two quickfire yellow cards -- the second for a tug on Australia's Riley McGree.
The South American side never quite recovered from the setback, as substitute Marco Tilio added a second for the Olyroos in the 80th minute to seal a memorable win.