Rio de Janeiro - Brazil will face South Africa in the opening game of the men's Olympic soccer tournament as the five-time World Cup champions try for their first gold medal.
Brazil lost to Mexico in the Olympic final four years ago in London.
The match is set for Aug. 4 in Brasilia, a day before the Olympics officially open in Rio de Janeiro. Iraq and Denmark are also in the group.
In Thursday's draw at the Maracana Stadium, defending champion Mexico was put in a group with South Korea, Fiji and Germany.
It's unclear if Brazil striker Neymar will be playing in his native country. The Brazilian football confederation has requested that he be available for the Copa America Centenario tournament in June in the United States, and then the Olympics.
Barcelona has not indicated it will release him for both events.
Brazil will also play the opening match in the women's tournament, against China on Aug. 3 in Belo Horizonte. Sweden and South Africa are also in the group.
The defending champion United States was drawn in a group with France, New Zealand and Colombia.
Japan, the runner-up four years ago, did not qualify this time.
Draw
Men
Group A: Brazil, South Africa, Iraq, Denmark
Group B: Sweden; Colombia; Nigeria; Japan
Group C: Fiji; Korea Republic; Mexico; Germany
Group D: Honduras, Algeria, Portugal, Argentina
Women
Group E: Brazil, China, Sweden, South Africa
Group G: USA, New Zealand, France, Colombia
Group F: Canada, Australia, Zimbabwe, Germany