Spain won their final warm-up game against El Salvador in Maryland, but made hard work of breaking down their opponents.
The world and European champions could have been ahead in the third minute when they were awarded a penalty after Diego Costa went to ground in the area, but Cesc Fabregas thundered his spot kick over the crossbar.
La Roja didn't let the missed opportunity faze them and went close again moments later as Pedro latched onto a Xabi Alonso through-ball, but his attempted chip failed to beat keeper Derby Carrillo.
Carrillo needed to be alert on 11 minutes when Fabregas produced a rasping shot that was well stopped by the El Salvador number one.
Spain continued to dominate possession and almost forged a lead midway through the first half as Costa found himself with the chance to score his first international goal, but Guillermo Garcia was on-hand to block the Brazilian-born attacker as he unleashed his shot.
El Salvador's best chance of scoring came when a loose back-pass from Juanfran saw Rafael Burgos bearing down on goal, but Iker Casillas cleared the danger.
Vicente del Bosque's side continue to enjoy more of the play, but were made to wait until the hour mark for their breakthrough when MLS-bound David Villa was allowed to tuck the ball into an empty net after Carrillo had left himself stranded.
The world champions almost added a second on 82 minutes when Sergio Busquets fired an effort from the edge of the box and beat Carrillo, only to see his effort come back off the crossbar.
Villa did double Spain's lead in the dying moments when he turned David Silva's cross into the El Salvador net.
Spain begin the defence of their trophy with a repeat of the 2010 final against the Netherlands on Friday.