El Salvador goalkeeper Henry Hernandez, left, and Spain goalkeeper Iker Casillas exchange jerseys at FedEx Field. The game drew 53,267 and was a World Cup warm-up game for Spain. (Toni L. Sandys/The Washington Post)

Spain won its final tuneup before the World Cup on Saturday, defeating El Salvador, 2-0, on David Villa’s second-half goals before 53,267 at FedEx Field. Given the circumstances, however, this was as much of a triumph for the Salvadorans as it was for the planet’s premier soccer squad.

Even in optimal condition, El Salvador has no business competing with Spain, the two-time defending European champion and reigning world-beater. But La Selecta is also recovering from a match-fixing scandal that resulted in 14 lifetime suspensions and six other penalties last year.

Plus, any single Spanish player earns more money than the entire Salvadoran squad. Yet El Salvador played with courage and determination.

It never threatened to score but stood up to its mighty foes and did not concede a goal until the 60th minute.

“I am very proud of the effort of my players. I want to salute them,” said El Salvador Coach Albert Roca, a Spaniard who accepted the job last month. “When we began this process two weeks ago, everyone knew what the circumstances were.”

The biggest single-event sports competition on Earth is set to kick off once again. From the reign in Spain to the United States’s fierce competition, here’s what you need to know. (Davin Coburn/The Washington Post)

Roca’s tenure formally began Wednesday in suburban Dallas with a respectable 2-1 loss to World Cup-bound Ivory Coast.

To understand what El Salvador was up against, consider the starting lineups. Six Salvadorans work in their lightly regarded domestic league, two are on the Hungarian circuit, one in Guatemala and one apiece with the San Antonio Scorpions and Orlando City — one and two tiers below MLS, respectively.

Spain? Three are employed by Real Madrid, which two weeks ago won its 10th Champions League trophy; four by global titan Barcelona; three by Atletico Madrid, which beat out Real and Barca for La Liga’s title last month; and one for Bundesliga champion Bayern Munich.

Six other elites entered in the second half.

For the Salvadorans, this opportunity was more about the experience than competing with the world’s top-ranked team, which will arrive on Brazil on Monday ahead of its Group B opener Friday against the Netherlands, a rematch of the 2010 final.

“They were very disciplined,” Spain Coach Vicente del Bosque said. “They made it difficult for us to be able to impose our style of game.”

The Salvadorans reached halftime without a deficit despite conceding a penalty kick in the opening moments and falling under extreme duress. They absorbed and chased and weren’t shaken by Spain’s star power.

It did not start well, though, as goalkeeper Henry Hernandez upended Diego Costa in the box. Cesc Fabregas, who is on the verge of moving from Barcelona to Chelsea, sent his penalty kick soaring over the crossbar.

Later, Hernandez made a fine save on Pedro Rodriguez in the box, and defenders Jonathan Barrios and Xavier Garcia blocked threatening shots.

Spain hoarded possession at an astounding 80.1 percent rate in the first half and 79.3 overall. Captain Iker Casillas, the goalkeeper from Real Madrid, was a solitary figure in Spain’s end.

“The first 10 minutes were very bad for us,” Roca said. “I have a young team, but they settled down.”

The deadlock held until Sergio Ramos beat Hernandez to Xabi Alonso’s high ball and headed it in front of the net. Side by side, Costa and Villa were waiting. Costa raised his right leg and tried to volley. Villa used his head. Villa, who will play for MLS expansion New York City FC next year, made first contact and avoided a kick to the skull.

El Salvador continued to show heart. In the 79th minute, three defenders threw their bodies at a shot deep in the box. A minute later, Spain’s Sergio Busquets pounded a 22-yard shot off the crossbar.

Villa added his second goal — and Spanish-record 58th overall — in the 87th minute, chesting down David Silva’s pass and steering an eight-yard shot into the left corner.

The reviews for Spain were lukewarm, but given the fortified opponent, mixed lineup and six substitutions, del Bosque was at peace. Costa, coming back from a hamstring injury that limited his availability for Atletico Madrid in the Champions League final, put in 74 minutes, while ailing Alonso and Juanfran received quality time.

“We are very optimistic after the training and the two games,” del Bosque said of victories over Bolivia last week and El Salvador. “We are meeting our expectations and are very optimistic for the World Cup.”

Soccer notes: RFK Stadium will host a Sept. 3 tripleheader on the opening day of the Copa Centroamericana, a seven-nation tournament being staged outside Central America for the first time. The specific matches have not been finalized.

Houston, Dallas and Los Angeles are the other venues, with the L.A. Coliseum hosting group games as well as the semifinals and final. Costa Rica, Honduras, El Salvador, Panama, Guatemala, Nicaragua and Belize will compete. The top four will qualify for the 2015 CONCACAF Gold Cup.