Manchester City forward Jesus Navas saved Spain's blushes by netting a late equaliser against Chile in an iternational friendly in Geneva.
Eduardo Vargas, who currently plays his football in Brazil, got both of the South American side's goals in the first half, which came either side of Roberto Soldado's equaliser.
World and European champions Spain were far from their best and for much of the game were outplayed by Jorge Sampaoli's side, who imposed themselves on their opponents with impressive levels of pressure.
Their energy levels eventually dropped and Vicente del Bosque's men made repeated efforts to find an equaliser late into the second half, which they got when Navas slid home in injury time.
The Spain coach kept to his word and made six changes to the side that beat Finland in a World Cup gualifier on Friday, the only players starting both games being Raul Albiol, Xavi Hernandez, Sergio Ramos, Pedro Rodriguez and Cesc Fabregas. In the second half Real Madrid centre-back Nacho Fernandez made his international debut, aged 23.
Chile had lost all three of their previous ties with Spain under Del Bosque, but took a surprising early lead. Mauricio Isla played a low ball through the middle of the Spain defence, which stood still thinking Vargas was offside, but the Gremio forward - who is on loan from Napoli - was in line with Sergio Ramos and slotted past a statuesque Victor Valdes.
Pedro sought to reply not long after, taking an early shot from outside the area which bounced just wide of the near post. Later Xavi pounced on a loose ball to try his luck from range but saw his shot blocked and out for a corner.
Spain got another scare midway through the first half, their defence stretched as Chile swarmed forward, but Albiol was able to clear the danger with the help of Monreal.
Spain levelled eight minutes before the break. Pedro found space on the right hand side following a pass from Alvaro Arbeloa and was able to deliver a perfect ball towards Soldado, whose header was too powerful for Claudio Bravo to keep out.
Fabregas almost caught Bravo out with a deep cross from the left hand side which ended up striking the upright. Just before the half-time whistle blew, Chile struck again. Vargas received the ball 30 yards from goal with his back to area after a pass from Marcelo Diaz. He then outmuscled Albiol to advance into the area and shot into the bottom corner with his left foot.
Santi Cazorla tried to offer a quick response immediately after the break, shooting at goal from 25 yards out, but Bravo was able to parry the ball away. With little over half an hour remaining Pepe Reina replaced Valdes, and had to be quick to come off his line and save from Isla barely a minute after coming on.
Barcelona forward Alexis Sanchez could have put the game beyond Spain with 15 minutes remaining when he appeared at the far post but headed wide. At the other end, substitute Navas showed great control to take down a long ball on the edge of the area, but could not get enough power on his shot to beat Bravo.
With five minutes remaining Navas almost provided his City team-mate Alvaro Negredo with the equaliser, but the striker was inches away from getting a toe on the end of the cross, which rolled across the Chile six-yard area. In the final minute, Pedro hit a soft effort which was easy for Bravo to gather, but once again Navas was at the heart of Spain's creativity.
And in the final minute, the former Sevilla player got the goal his persistence deserved. This time Negredo attacked down the left, playing in Pedro, who put a low pass right into the six yard box, where Navas slid the ball into the bottom corner, preventing his country from falling to what would have been their second defeat in four games.