The Republic of Ireland went out of the World Cup on penalties after staging a superb comeback against Spain in Suwon.
Spain went ahead in the eighth minute through Fernando Morientes and looked on their way to a comfortable victory.
But Ireland, invigorated by the introduction of Niall Quinn early in the second half, fought back and looked the more likely winners after the interval.
Ian Harte had already missed a penalty before his Leeds team-mate Robbie Keane equalised from the spot in the final minute of normal time.
Mick McCarthy's side continued to control the match in extra-time and went desperately close through the outstanding Damien Duff and defender Gary Breen.
But Matt Holland, David Connolly and Kevin Kilbane missed in the shoot-out to allow Gaizka Mendieta to score the penalty that sent Spain into the last eight.
We didn't deserve an end like that - we deserved to win in normal time
Spain, so comfortable in possession and threatening on the break, completely dominated in the first-half and went ahead through Morientes.
The goal was magnificently taken but Spain were aided considerably by some awful Irish defending.
Carles Puyol picked up the ball from a throw-in and was able to get a cross in far too easily.
Morientes got in front of Breen at the near post and glanced a header past Shay Given for his third goal of these finals.
Spain, with Raul and Morientes showing excellent movement in attack and Juan Carlos Valeron excellent touches in behind them, almost added to their lead on numerous occasions.
Luis Enrique did manage to get the ball in the net but his effort was disallowed for a marginal offside.
Mendieta is mobbed after sneaking Spain through
Ireland had to make a change and it was no surprise when McCarthy brought veteran striker Niall Quinn on for Gary Kelly early in the second half.
Duff moved out to the wing, a position he fills with such distinction for Blackburn, and Ireland immediately posed more of a threat.
And it was Duff who won Ireland's first penalty, cutting in from the right before being tripped by Juanfran.
Harte, normally so lethal from set-pieces, struck his penalty too close to Casillas and it was pushed out.
Kevin Kilbane followed up but his shot from the rebound went embarrassingly wide of the post.
Ireland piled forward in the closing stages. Duff shot wide of the far post after a thrilling run and Keane was brilliantly thwarted by the outstanding Casillas.
They eventually won a second penalty in the final minute when Fernando Hierro was deemed to have pulled Quinn's shirt at a free-kick.
This time Robbie Keane stepped up and sent his penalty to the right of Casillas.
Ireland had the better of their opponents in extra-time who had been reduced to 10 men by a groin injury to substitute David Abelda.
Breen and then Keane went close for Ireland before they had to suffer the agony of going out of the World Cup on penalties.
Spain: Casillas, Puyol, Helguera, Hierro, Juanfran, Baraja, Valeron, De Pedro (Mendieta 66), Luis Enrique, Raul (Luque 80), Morientes (Albelda 71).
Subs Not Used: Contreras, Curro Torres, Joaquin, Nadal, Ricardo, Romero, Sergio, Tristan, Xavi.
Booked: Juanfran, Baraja, Hierro.
Goals: Morientes 8.
Rep of Ireland: Given, Gary Kelly (Quinn 55), Staunton (Cunningham 50), Breen, Harte (Connolly 82), Finnan, Kinsella, Holland, Kilbane, Duff, Keane.
Subs Not Used: Carsley, Dunne, Kiely, McAteer, Morrison, O'Brien, Reid, Alan Kelly.
Goals: Keane 90 pen.
Spain win 3-2 on penalties.
Referee: Anders Frisk (Sweden).
OFFICIAL MATCH STATS |
| Spain | Rep of I |
Goals | 1 | 1 |
Penalty shoot out | 3 | 2 |
Shots on goal | 11 | 18 |
Shots on target | 6 | 6 |
Fouls committed | 19 | 23 |
Corner kicks | 5 | 6 |
Penalty kicks | 0 | 2 |
Caught offside | 13 | 1 |
Own goals | 0 | 0 |
Yellow cards | 3 | 0 |
Red cards | 0 | 0 |
Ball possession (%) | 45 | 55 |
ACTUAL PLAYING TIME | |
First half - 36 mins | Second half - 44 mins |