Richarlison scored a hat-trick inside the first 30 minutes to lead defending Olympic champions Brazil to a 4-2 win over Germany in their opening Group D game in Yokohama on Thursday. Brazil should have had the match wrapped up by half time but Germany struck twice in the second half, despite going down to 10 men in the 63rd minute, to ensure a tense final few minutes inside the International Stadium, before Paulinho's injury time goal guaranteed all three points for Brazil. Richarlison 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 an unexpectedly nervous the 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. Earlier, France got their Olympic campaign off to a nightmare start with a 4-1 defeat by Mexico. Sylvain Ripoll's France are looking for a first Olympic medal since winning gold in 1984, but collapsed in the second half at Tokyo Stadium. "We're obviously disappointed with the result but also with the balance of our play," said Ripoll. "To compete, we would've needed a big performance, but that wasn't the case." Mexico took the lead less than two minutes after the break through Alexis Vega, before Sebastian Cordova doubled their advantage in the 55th minute. The 35-year-old captain Andre-Pierre Gignac, whose last game for the France senior team was the Euro 2016 final loss to Portugal, pulled one back from the penalty spot with 21 minutes remaining. But any thoughts of a comeback were quashed as Uriel Antuna and Eduardo Aguirre netted late on for 2012 champions Mexico. France now face a tough task to get out of Group A with a top-two finish, ahead of games against South Africa on Sunday and hosts Japan on July 28. "The first thing we now have to do is digest this disappointment," Ripoll said. "We only have two days. There's no time to waste." Japan saw off South Africa, who had two players test positive for Covid-19 on Sunday, 1-0 thanks to Takefusa Kubo's second-half strike. Ivory Coast also picked up three points in Group D as AC Milan's Franck Kessie netted the match-clinching goal in a 2-1 victory over Saudi Arabia. Spain struggled in Sapporo, as a team featuring six players who reached the Euro 2020 semi-finals dominated possession but created few chances in a 0-0 draw with Egypt. The closest they came to a goal was when Real Madrid midfielder Dani Ceballos, who recently spent two seasons on loan at Arsenal, crashed a first-half shot against the post. Spain, winners on home soil in 1992, next take on Australia in three days' time before their final Group C match with Argentina. Australia took early control in the table, as goals from Lachlan Wales and Marco Tilio saw them beat 10-man Argentina 2-0. New Zealand made a successful start in Group B as Burnley striker Chris Wood, one of the three over-age players in the squad, secured a 1-0 victory over South Korea in Kashima with his 72nd-minute winner. It was their first-ever win in Olympic football, having managed just one draw in each of the 2008 and 2012 tournaments. An own goal saw Romania edge out Honduras 1-0 in the group's other game.