Juan Valenzuela was the unlikely hero for Mexico, who were outclassed by Peru but somehow played out a 1-1 draw in an international friendly in Lima.
Peru - in their first and only fixture before next week's Copa America in Chile - dominated from start to finish and looked set for a convincing win after Jefferson Farfan gave the home side a 62nd-minute lead at Estadio Nacional de Lima on Wednesday.
However, Mexico went up the other end and equalised against the run of play via Valenzuela with 14 minutes remaining.
Peru, who are not in action until their Group C opener against Brazil on June 14, ended the match with 10 men after substitute Pedro Requena was sent off in the 78th minute.
Mexico take on Brazil in a friendly on Sunday before kicking off their Copa campaign against Bolivia on June 12.
It was one-way traffic in the first half, with Mexico goalkeeper Alfredo Talavera kept busy throughout.
Talavera was forced into a low save at his near post in the fifth minute after Peru striker Pablo Guerrero cut inside the penalty area and weaved his way past two defenders, while the keeper produced a fingertip save six minutes later.
Guerrero continued to torment the visitors' defence and he came within a whisker of opening the scoring in the 24th minute, though his shot flashed just wide of the post as Mexico somehow manage to go into the break on level terms.
Peru continued where they left off in the second half and were finally rewarded for their efforts just past the hour-mark thanks to Farfan, albeit in fortuitous circumstances.
Guerrero's attempted cross deflected off the post, deceiving the keeper as Farfan was on hand to bundle the ball over the line in the 62nd minute.
It took 70 minutes for Mexico to register their first shot on target, but substitute Luis Montes was denied by Pedro Gallese.
The Mexicans, however, restored parity against the run of play, Valenzuela heading Montes' free-kick past Gallese with 14 minutes remaining.
Things threatened to go pear-shaped for the Peruvians two minutes later after Requena was sent off for a second bookable offence, but the hosts held on for a draw.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1