Luis Neto bundled into his own net to hand Mexico a 54th-minute lead, but centre-back Pepe stabbed home a stoppage-time equaliser to force an extra 30 minutes at Spartak Stadium.
Both sides were reduced to 10 men in the final stages as Portugal defender Nelson Semedo and Mexico substitute Raul Jimenez were sent off for two bookable offences.
Portugal's Fernando Santos made eight changes from the loss to Chile in the semifinals, with Cristiano Ronaldo absent after leaving the squad to spend time with his newborn twins.
Washington lève l'interdiction des ordinateurs en cabine sur les vols d'Etihad
Il s'agit de la première compagnie aérienne à bénéficier de la levée de cette interdiction, en vigueur depuis le 21 mars.
Portugal fell in a penalty shootout after a 0-0 draw, and will be without its star player for the third-place match.
Guillermo Ochoa showed sharp reflexes in the 16th to stop Andre Silva's penalty, awarded after he was brought down by Rafael Marquez.
Adrien Silva converted the kick to give the European champions a hard-fought victory.
"Both teams played some intelligent football today but Portugal were just slightly better", Ochoa admitted.
- Portugal beats Mexico in Confederations Cup third place game
- Carmelo Anthony Open to Waiving No-Trade Clause for Cavs or Rockets
- Myanmar migrant workers flee Thailand after new labour law
- Londonderry security alert a 'hoax'
- Liverpool respond to approach from Euro giants for attacker, name asking price
- ASUS' 'Zenfone' smartphones now available at exciting prices
- " "Le jour où Neymar a eu " honte " devant Messi — FC Barcelone
- Google marks 140th anniversary of Wimbledon with an animated doodle
- Quel avenir pour Bouna Sarr — Mercato
- Kaspersky Offers Source Code To US Government