[captionpix imgsrc=”https://thecostaricanews.com/wp-content/uploads/2011/11/CR_ESP.jpg” align=”left”]AP SAN JOSE, Costa Rica — David Villa headed an injury-time equalizer Tuesday to salvage a 2-2 draw for Spain at Costa Rica, avoiding a second straight friendly loss for the world champion.

Goalkeeper Iker Casillas’ Spanish record 127th appearance was marred when he let in first-half goals by Randall Brenes and Joel Campbell, with Costa Rica’s counterattack looking dangerous on the patchy grass at San Jose’s National Stadium.

Casillas was replaced by Victor Valdes after halftime and David Silva came on to help Spain’s attack, scoring in the 83rd minute. Villa then finally beat sturdy Costa Rica goalkeeper Keilor Navas in the second minute of added time for his 51st international goal.

The European champions avoided consecutive losses for the first time in five years although they continued to struggle in friendlies since their World Cup triumph, winning only three and losing four of its 10 friendlies since.

Spain’s players, coming off the trans-Atlantic flight following Saturday’s 1-0 loss at England, laboured on a difficult pitch from the start as Joel Campbell troubled the visitors’ defence, with the hosts looking to expose central defenders Sergio Ramos and Carles Puyol on the countera-attack.

Casillas was outdone by counterpart Keilor Navas, who made a number of impressive saves throughout, starting with Xavi Hernandez’s opportunistic effort after seven minutes.

Brenes shot over Casillas twice before finally making the breakthrough when the Spain ‘keeper rushed out to cut off a pass but lost his balance and the ball, with the Costa Rica forward waiting a moment before lobbing over the defence into the empty net.

Navas stopped Villa on the first of several occasions right after the opener, before Ruiz curled the ball past Casillas but around the far post after Campbell, the Arsenal striker playing at FC Lorient, played him clear in the 37th.

Campbell soon found space in the middle and unleashed a left-foot shot that Puyol was unable to block and beat a diving Casillas for 2-0.

Spain coach Vicente del Bosque brought in Sergio Busquets to help the defence at the start of the second half, with Silva and wingers Jesus Navas and Santi Cazorla also in to spread play out wide.

Spain created most of the chances from then onwards with Andres Iniesta scooping high in the 58th before Keilor Navas flew across goal to save Villa’s free-kick in the 65th.

Villa shot into the side netting minutes later before getting a quick shot away wide in the 74th while falling, as Spain dominated the game.

Iniesta continued to exploit space along the left as the Barcelona playmaker took Silva’s pass deep before feeding back to the Manchester City forward to score with a well-controlled shot.

Ramos should have equalized but his 87th-minute header went wide. Villa finally beat Keilor Navas as the striker crouched low to guide Cazorla’s free kick into the area into the bottom corner.