Peralta struck after just 30 seconds and the Mexican striker sealed one of the all-time great Olympic upsets when he scored again late in the second half.
Hulk got one back in stoppage-time but Mexico, playing in their first Olympic final, were deserved winners as Brazil once again failed to end their long wait for a first football gold.
Brazil, bronze medallists in Beijing in 2008, lost in the Olympic final in 1984 and 1988 and their failure to win gold has rankled with such a proud football nation for decades.
SRK-Gauri anniversary: B-Town stars and their non-filmi better halves
Birthday special: Popular mothers and daughters in Bollywood
Spotted: 'Kaabil' star Hrithik Roshan with dad Rakesh Roshan
'Rock On 2' trailer launch: Farhan, Shraddha enthrall audience with live gig
Photos: Deepika Padukone, Sushmita Sen with daughters at Mumbai airport