Substitute David Silva saved world champions Spain's blushes with a stoppage-time equaliser for a 1-1 draw against Mexico at the Azteca on Wednesday.
Mexico, who took a 12th-minute lead in the friendly through striker Javier Hernandez, had looked set to defeat Spain in their first outing since winning the World Cup in South Africa a month ago.
Hernandez chased a ball into space, faced goalkeeper Iker Casillas and, with the Spain captain expecting a shot across his body, slotted the ball inside the near post.
Mexico, showing greater urgency than Spain, were worth their lead but the arrival of Xavi just past the hour injected some bite into the Spanish attack.
Spain, playing their trademark short passing game at a near walking pace in the first half, had come closest when a venomous shot from Santi Cazorla rattled Guillermo Ochoa's crossbar.
Casillas had to make a diving save from midfielder Rafael Marquez before ceding his place to Victor Valdes in the second half.
Substitute Pedro, who came on in the 72nd minute, brought a good save from Mexico's substitute keeper Jesus Corona when he looked set to equalise three minutes from time.
Silva made no mistake two minutes into added time when he ran on to a fine through ball from Xavi to slot it past Corona.
Spain became the latest world champions not to win their first match after lifting the FIFA trophy. Brazil in 1994 were the last team to win a match immediately after their World Cup success.
Mexico's Hernandez follows grandfather's footsteps
FIFA credit Dutch equaliser to Sneijder
Spain's Silva completes move to Manchester City
Barcelona slam Del Bosque over Spain squad
Barcelona release Mexico captain Marquez