Spain learned the lesson of Italy and France. But Chile's still alive, and South America keeps on rolling.
With Spain staring at an early exit from the World Cup, David Villa and Andres Iniesta each scored and the Spanish beat Chile 2-1 on Friday. The result sends both teams on to the round of 16.
In a tournament that has already sent 2006 finalists Italy and France home, Spain was another upset victim — losing to Switzerland in the opener. That set up a critical final group match.
Villa got his goal on a shot from 45 yards out in the 24th minute, when goalkeeper Claudio Bravo came out of his area and cleared a ball straight to the Spain striker.
"David's goal was very important because it occurred at a time when it was very uncomfortable for us," Iniesta said. "After the goal, we felt more comfortable on the pitch."
Iniesta then doubled the advantage by beating Bravo with a right-footed shot from the edge of the area in the 37th, with Marco Estrada ejected after collecting his second yellow card on the play.
"It was even until the ejection," Chile coach Marcelo Bielsa said. "We never thought we were better than Spain though we could compete with Spain on equal footing. But from the 40th minute, the match changed its complexion entirely."
Chile didn't back down, though, pressing and scoring on substitute Rodrigo Millar's deflected shot in the 47th.
Spain finished at the top of Group H with six points and will play Portugal in the next round. Chile was second and will play Brazil. Switzerland was third and Honduras was last.
"We have a unique opportunity," Iniesta said. "The team has demonstrated a good attitude. The draw with Portugal is difficult."
Villa scored when he ran on to the loose ball and curled a high, left-footed shot from just inside the Chile half into an open goal. Bravo had rushed out of the area to clear Alonso's long ball as Fernando Torres chased it down.
Later, Villa and Iniesta — returning from a right leg injury — worked the ball down the field together with Iniesta side-footing it past Bravo into the far corner.
"We have reacted a very difficult situation and have done well," Spain coach Vicente del Bosque said. "There's a lot of pressure in Spain" for us to go further and "we want to do well."
Estrada, who was replacing the suspended Carlos Carmona, was already yellow-carded in the 21st minute and was shown a red card for tripping up Torres during the buildup to the second goal.
Chile was the first South American team to lose a match at the 2010 World Cup, but all five of the continent's teams have qualified for the second round.
"I think that we deserved to advance because of the two previous matches," said Chile midfielder Rodrigo Millar. Chile beat Switzerland and Honduras, and only lost to Spain in the group standings on tiebreakers.
"We now have a difficult match against Brazil in the next round. We know we're going to face one of the biggest teams in the world."
The Chileans will be without defender Waldo Ponce against Brazil on Monday after he picked up a yellow card in the 20th for kicking Torres.