Spain dominated the Central American minnows at the FedEx Stadium and barely broke into a sweat in securing a comfortable victory ahead of their opening Group B match against Netherlands in Salvador on Friday.
Vicente Del Bosque's team squandered a chance to take an early lead when Diego Costa was felled in the penalty area by goalkeeper Henry Hernandez and Cesc Fabregas smashed his fourth-minute spot kick over the crossbar.
Villa, whose goals helped propel Spain to their maiden world title in South Africa four years ago, came off the bench at the break and was in the right place to nod in a Sergio Ramos knockdown in the 60th minute.
Another substitute, Sergio Busquets, crashed a long-range effort against the crossbar in the 80th minute before goalkeeper David De Gea made his debut for La Roja when he replaced captain Iker Casillas for the final 10 minutes.
David Silva floated the ball into the area three minutes from time and Villa chested it down before firing into the corner on his 96th appearance.
"We know that Villa, in tight spaces, is one of the best forwards in the world," Del Bosque told a news conference.
"The feelings are good and we are optimistic about the start of the competition. We perhaps lacked fluidity and precision when closing in on goal but we kept our shape well," he said.
Villa, 32, announced this week he was leaving Atletico Madrid to join Major League Soccer team New York City.
He has not been the same lethal marksman since breaking his leg at the end of 2011 but his double is good news for Spain as they bid to become only the third nation to retain the World Cup after Italy in 1938 and Brazil in 1962.
Del Bosque had the players from Champions League finalists Real Madrid and Atletico available after they joined up with the rest of the squad on Monday and it was a chance to test the fitness of the likes of Costa.
The Brazil-born Atletico forward struggled with a series of niggling muscle injuries in the final weeks of the domestic season but looked fit and lively before being replaced by Xavi in the 73rd minute.
Jordi Alba took a painful-looking knock to his ankle in the first half but Del Bosque said the Barcelona left back had not sustained serious injury.


Latest News from Sports News Desk