David Villa scored a second-half goal for Spain to beat Portugal 1-0 on Tuesday and book a World Cup quarter-final against Paraguay.
Spain's 1-0 victory over their Iberian neighbours will ensure that they advance through the quarterfinal round where they will come up against Paraguay, who earlier in the day saw off Japan after a penalty shoot-out.
Spain, the world's No 2 ranked country, have never won the World Cup, although they have previously reached the quarterfinal round five times.
Their victory also means that the 2010 World Cup showpiece in South Africa will be robbed of one of its superstars in Cristiano Ronaldo.
Portugal also finished the match with 10 men after Ricardo Costa was red-carded three minutes ahead of regulation time.
Straight from the kick-off Spain defied the slippery wet conditions by playing a crisp short inter-passing game rather than letting the ball do the work.
As pleasing as it was to the eye, it was equally penetrative and there were ominous signs that Spain could be heading for an early reward.
But Portugal goalkeeper Eduardo was alert to the speculative attempts landed from the fringes of the penalty area by the Spanish striking pair Fernando Torres and David Villa in the first six minutes of the match, by which time he also warded off danger from a corner.
Portugal were forced to settle for a largely defensive role and with Eduardo's vigilance they managed to avert early danger. And when counter-attack options beckoned they attacked strongly and with great pace down the flanks.
Their early attacking efforts brought them two corners in quick succession in the opening 10 minutes but Spain's defence were equal to the task of keeping Portugal's Cristiano Ronaldo-led attack at bay.
Ronaldo had a chance to stamp his mark on the match after some 20 minutes play when he struck two long-range free-kicks, in the space of three minutes, from about 40 metres out.
Both were stopped by Spanish 'keeper Iker Casillas, although he failed to gather the second effort cleanly but the opposition marksmen were not at hand to pounce on the stray ball in front of the Spanish goal.
The referee Hector Baldassi of Argentina seemed to enjoy a firm grip on the match and dealt with fouls promptly and without much fuss.
This helped the flow of the game in which both sides were fairly creative in their approach work.
Spain enjoyed a decided territorial advantage in the first half but Portugal, patient and smart in defence, often managed to reverse the flow of the match by dispossessing the opposition in and around the striking zone.
Portugal continued to keep their claims alive with strong break-outs from their half and Ronaldo's striking partner Hugo Almeida was at the receiving end of two half-chances ahead of the break to hit the target.
However, both attempts went wide, much to the relief of the Spaniards who looked increasingly vulnerable as the first half wound to its close.
Spain continued where they left when play restarted and although they managed to take play up the opposition penalty area with ease, they were not able to set up real scoring opportunities at the end of several sorties.
Considering their surfeit of possession, the Spanish must have been reminded of their shock defeat at the hands of the Swiss in Durban two weeks ago when they failed to exploit their opportunities.
But Spanish coach Vicente del Bosque made an inspired substitution in the 58th minute that almost brought immediate dividends.
The out-of-form Torres was replaced by his namesake Fernando Llorente, and after only two minutes on the pitch he came close with header.
The Spanish did, however, make the breakthrough four minutes later when Villa steered a rebound past Eduardo after the keeper parried his initial effort.
The goal lit a spark in Spain's ranks and in the ensuing minutes they swarmed forward into Portugal's half with threatening moves, one of which saw a Sergio Ramos strike turned away for a corner in the 69th minute.
Portugal did not look like recovering from this setback as Spain simply shut out the their opposition while winding the clock down with great effect.