Spain scored twice in the first half and held on for a 2-1 win over a 10-man Chile team, setting up a Round of 16 battle against fellow powerhouse Portugal.
Chile also advanced despite the loss as Switzerland, who needed a win against Honduras for a chance to move on, settled for a draw. The South American nation will face Brazil in the elimination round.
David Villa opened the scoring for Spain in the 24th minute, and countryman Andrés Iniesta added a goal of his own 13 minutes later.
Chile began the second half with more fire in their step, and they were rewarded in the 47th minute as midfielder Rodrigo Millar booted a brilliant goal from 20 yards out into the left-side corner to cut the lead to one.
Spain settled down defensively though, holding back the Chilean attack and treating much of the latter part of the match as a game of keep-away.
Villa’s goal was his third of this year’s tournament and sixth overall at the World Cup, making him Spain’s top goal scorer at football’s greatest stage. And what a goal it was to add to his impressive legacy.
With Spain’s defence looking shaky early and Chile mounting the most pressure, defender Xabi Alonso took it upon himself to get the offence rolling.
Corralling a loose ball from his end, he sent the ball well down the line to a streaking Fernando Torres.
The striker chased after the pass against a Chilean defender, but were both beaten to the ball by goalkeeper Claudo Bravo, who made a terrific sliding challenge from 30 yards to kick it away.
Unfortunately for Bravo, the ball found its way to Villa, who from 40 yards out curled a left-footed shot into the empty net for the perfect strike.
Spain looked more at ease on offence after that, passing the ball well and playing creatively in front of the Chilean net.
In the 37th minute, Villa once again shows some flair on the attack, working a pretty give-and-go play with Iniesta.
Receiving the ball 20 yards out from his fellow striker, Villa held the ball long enough to gather a Chilean defender.
He then passed the ball back to a ready and willing Iniesta, who calmly kicked the ball with the side of his foot into the far corner, past the outstretched hands of Bravo.
On that same rush, Torres, who was well away from the ball, got slightly clipped by Marco Estrada, which resulted in a yellow card for the Chilean midfielder.
As it was Estrada’s second yellow card of the game, he got red-carded and Chile played the remaining 53 minutes a man short.
Chile regrouped in the second half though thanks to Millar’s goal, setting up a possible what could have been an exciting finish.
Instead, the complexion of the match changed towards the end thanks to the play of Switzerland in their game against Honduras.
As it became apparent by the 80th minute that Switzerland were not going to score two goals and defeat Honduras, Chile opted to play it safe and settle for the loss rather than risk more goals and possible injury.
Chile threw up a wall on defence and made no moves whatsoever on offence, and the match slowed to a crawl as a result. Spain was content with Chile’s new game plan, passing the ball amongst themselves to finish off the win.
The gamble paid off as Switzerland’s draw ensured Chile’s second-place finish.