Defending champions Brazil had to rely on penalties to beat Mexico in the first of two men's Olympic football semi-finals on Tuesday.
The Selecao dominated possession and the number of chances in the first half, but an organised Mexico side limited the quality of those chances while also threatening on the break in a cagey affair that featured nine yellow cards.
Guilherme Arana had an early opportunity to score after storming into the box from the left flank, but the Brazil left-back's eventual effort was straight at Mexico captain Guillermo Ochoa between the sticks.
Dani Alves becomes the most decorated player in football as Brazil secure Olympic gold
Just 15 minutes later VAR overturned the referee's decision to award a penalty when El Tri's Jose Esquivel appeared to bring Douglas Luiz in the box.
The first half ended with a trio of agonisingly close chances for Mexico before a drab second half and period of extra time ensured penalties always seemed like an inevitability.
In the penalty shootout, Mexico went out with a whimper, losing 4-1 with Borussia Dortmund's on-loan teenager Reinier sealing their fate.
'Look at the pace he's got here' Malcom races away to secure football gold for Brazil
'Didn't fancy him at all!' - Richarlison with penalty shocker for Brazil in final