Sandro played 71 minutes before being substituted in a match Brazil were widely expected to win.
Mexico, playing without the injured Giovani, took the lead after just 32 seconds through Oribe Peralta to stun the pre-match favourites.
Peralta scored again in the 75th minute after the striker was left completely unmarked to head home from eight yards out to make it 2-0. Hulk gave Brazil hope with a late strike, but it turned out to be nothing more than a consolation goal.
Congratulations to Sandro and Gio for their success at the Olympic Games!