Hector Moreno struck in injury time as Mexico twice came from behind to secure a draw with Portugal in their opening Confederations Cup Group B game in Kazan.
There was drama at the end of both halves as Javier Hernandez headed Mexico level two minutes before the break after Ricardo Quaresma had opened the scoring for the European champions.
Right-back Cedric Soares appeared to have sealed an opening day three points for Portugal when he saw his 86th-minute effort deflected home but Moreno rose highest to ensure the points were shared.
Portugal had the ball in the net shortly before the midway point in the net as Cristiano Ronaldo saw his volley acrobatically turned onto the crossbar by Mexico goalkeeper Guillermo Ochoa.
From the rebound, Joao Moutinho drilled the ball towards goal and Pepe headed into the net only for the Video Assistant Referees to correctly rule the goal out for an offside in the initial move.
Cedric saved well from Cedric and tipped a deflection from defender Carlos Salcedo over the bar before Portugal finally took a deserved lead.
Salcedo misjudged a ball over the top and, though he got back to hold up Ronaldo, the Real Madrid striker showed great vision to slide in Quaresma, who wrong-footed Ochoa before sliding home.
Another defensive error led to Mexico's equaliser just before the break as Raphael Guerreiro lost sight of Raul Jiminez's cross and Carlos Vela popped the ball back across for Hernandez to head in.
The Mexicans should have taken the lead on the stroke of half time as Jiminez pulled the ball back for Hernandez inside the box but the Borrusia Moenchengladbach striker ballooned his shot.
Portugal turned the screw in the final minutes as they sought a winner and they got it when Cedric wandered forward from right back and saw his close-range shot loop in off Hector Herrera's foot.
Mexico's chance appeared to have passed when Hernandez fluffed a chance from close range but Moreno rose to nod a free header home in the first minute of injury time to snatch a share of the spoils.