Richarlison continued his fine form at the Olympics with a double as Brazil eased into the quarter-finals after a 3-1 win over Saudi Arabia on Wednesday, as Germany exited the men’s tournament.
Reigning champions Brazil, who won gold for the first time on home soil in Rio de Janeiro five years ago, finished top of Group D and will face the runners-up from Group C in the last eight on Saturday.
Matheus Cunha put them ahead in Saitama on Wednesday, but Abdulelah Al-Amri’s goal brought the Saudis level before the half-hour mark.
A draw would have been enough for Brazil to go through as group winners, but Richarlison netted in the 76th minute and again in injury time.
The Everton forward is now the leading scorer in the tournament with five goals after his hat-trick against Germany.
The Germans, runners-up to Brazil in 2016, bowed out after a 1-1 draw with the Ivory Coast, who will face the Group C winners in the quarters.
Germany had to win to progress, but Benjamin Henrichs’ own goal midway through the second half proved costly.
Eduard Lowen’s equaliser shortly afterwards set up a tense finale, but the Ivorians held on to seal second spot in the group.
South Korea finished top of Group B after a 6-0 thrashing of 10-man Honduras and were joined in the knock-out stage by New Zealand, who played out a goalless draw with Romania to finish above their opponents on goal difference.