European champions Spain set up a mouthwatering last-16 showdown with Cristiano Ronaldo's Portugal after seeing off 10-man Chile 2-1 in a hard-fought encounter in Pretoria.
David Villa put Spain ahead with a long-range shot into an empty net after Chile goalkeeper Claudio Bravo had raced out of his area, and Andres Iniesta doubled his side's lead towards the end of the first half.
Chile midfielder Marco Estrada earned a second booking for tripping Fernando Torres in the build-up to the Iniesta goal and although Chile pulled a goal back at the start of the second-half through Rodrigo Millar's deflected effort, they were unable to find an equaliser.
Chile started well but it was Spain who took the lead in the 24th minute when Villa took advantage of some reckless goalkeeping from Bravo to put his side ahead with a brilliant finish.
There appeared little need for Bravo to race out of the area and although he beat Torres to a through-ball, the Real Sociedad goalkeeper's clearance went straight to Villa, who lofted the ball into an empty net from 40 yards out and near the left touchline.
Chile briefly threatened an equaliser through Beausejour, Gerard Pique getting back to make a superb block, but then came the incident that put Spain completely in the ascendency, taking a 2-0 lead and also seeing Chile reduced to 10 men.
A good sweeping move resulted in Villa laying the ball back to his new club-mate Iniesta on the edge of the box, and the Barca midfielder coolly slotted into the far corner of the net.
And as the Spain players raced away to celebrate, Mexican referee Marco Rodriguez sent off Estrada for his innocuous-looking tangle with Torres, who was left lying on the ground on the edge of the area.
Spain could hardly have been in a better position at the interval, but they saw their two-goal advantage halved just two minutes into the second half. Millar found space on the edge of the area and fired in a shot that took a huge deflection off Gerard Pique before looping past Iker Casillas and into the net.
That was a huge boost for Chile, but they could make no further inroads and created little to worry Casillas in the remainder of the half. Marcelo Bielsa's side will now face Brazil in the last 16.
Years | Winners | Runner-up | Third place |
2006 | Italy | France | Germany |
2002 | Brazil | Germany | Turkey |
1998 | France | Brazil | Croatia |
1994 | Brazil | Italy | Sweden |
1990 | Germany | Argentina | Italy |
1986 | Argentina | Germany | France |
1982 | Italy | Germany | Poland |
1978 | Argentina | Holland | Brazil |
1974 | Germany | Holland | Poland |
1970 | Brazil | Italy | Germany |
1966 | England | Germany | Portugal |
1962 | Brazil | Czech | Chile |
1958 | Brazil | Sweden | France |
1954 | Germany | Hungary | Austria |
1950 | Uruguay | Brazil | Sweden |
1938 | Italy | Hungary | Brazil |
1934 | Italy | Czech | Germany |
1930 | Uruguay | Argentina | America |