Spain defeated gutsy Ireland in the first penalty shoot-out of the 2002 World Cup after the second round game had ended 1-1 after extra-time.
Matt Holland, David Connolly and Kevin Kilbane failed with their spot kicks, with Spanish goalkeeper Iker Casillas saving two of them, before Gaizka Mendieta stepped up to put Spain into the last eight.
Spain won the shootout 3-2.
The Spanish, trying to shake off a reputation as World Cup underachievers, looked to have sealed a place in the last eight for the first time since the 1994 finals thanks to an eighth minute goal from striker Fernando Morientes.
But Ireland, masters of the last-gasp comeback, drew level in the final minute of normal time when Swedish referee Anders Frisk awarded a penalty after Spanish defender Fernando Hierro pulled the shirt of substitute Niall Quinn in the area.
Striker Robbie Keane, who scored in the dying seconds against Germany in the first round, scored from the spot to send the game into golden-goal extra time -- hours after Senegal reached the last eight with only the second golden goal of World Cup history.
Spain's 21-year-old goalkeeper Iker Casillas had earlier saved a penalty from Ian Harte in the 63rd minute after a foul in the area by defender Juanfran on winger Damien Duff, who was a constant thorn in the side of the Spanish.
The winners now play either co-hosts South Korea or Italy next Saturday for a place in the semi-finals.
Ireland, whose World Cup campaign suffered a serious setback before the tournament when they lost their best player Roy Keane after a bitter row with coach Mick McCarthy, tested the Spanish until the final whistle.
Spain, who played extra time with 10 men, made the perfect start with the early goal from Morientes. Right back Carles Puyol sent in a crisp cross from the right and Morientes brushed off his marker Gary Breen to score with a glancing header past Ireland goalkeeper Shay Given.
The Spanish had the ball in the net again in the 25th minute when Luis Enrique poked home after a clever move involving Raul and Morientes but the goal was disallowed because of offside.
Keane's pace was a constant danger to the Spanish and two minutes before halftime his overhead kick went just over the bar.
Spain played the more attractive football, however. Morientes had a chance to give Spain a 2-0 lead just two minutes into the second half but Given managed to block his shot from just inside the box.
The Spanish desperately needed a second to make the game safe as Ireland kept threatening their defence, which has looked shaky at times during the tournament.
In the 51st minute, captain Fernando Hierro had to clear the ball off the line after forward Kevin Kilbane pounced to shoot after Casillas dropped a cross.
Then Ireland missed a perfect chance to get back into the game in the 62nd minute when Juanfran brought down Duff.
Harte struck the spot kick hard but too close to Casillas diving to his right and Kilbane failed to hit the rebound into a gaping net.
Duff almost grabbed an equaliser in the 80th minute with a wonderful run on the right which he finished with a long-range shot which just went past Casillas's right-hand post.
In the 84th minute, Casillas saved the day again, bravely blocking an acrobatic close-range effort from Keane, who broke clear in the box.
Spain, having used all their three substitutes, played extra time with 10 men after midfielder David Albelda stayed off after aggravating a groin strain.
Senegal edged out Sweden 2-1 earlier on Sunday, thanks to the second World Cup golden goal and the first of the tournament.