Two goals in the last three minutes gave Turkey a remarkable 3-2 comeback victory over Czech Republic in a winner-take-all Euro 2008 thriller on Sunday, earning a quarter-final meeting with Croatia.
The Czechs went 2-0 up with a first-half goal from their all-time leading scorer Jan Koller and a 62nd-minute effort from midfielder Jaroslav Plasil.
Arda Turan pulled one back 15 minutes from time and Turkey equalised with three minutes to go when keeper Petr Cech inexplicably dropped the ball for Nihat Kahveci to slide the ball into an empty net.
Turkey then grabbed a dramatic winner two minutes later when Nihat broke clear to fire a right-foot shot from the edge of the penalty area that went in off the underside of the bar.
The drama did not end there as Turkey keeper Volkan Demirel was sent off in stoppage time for pushing Koller over in an off the ball incident, Tuncay Sanli taking over in goal for the dying stages.
Turkey finished with six points, three ahead of the Czechs, who were eliminated along with co-hosts Switzerland. Portugal were top.
The breakthrough came after 34 minutes when Koller headed powerfully into the top corner with Volkan palming the ball on to the underside of the bar and into the net.
The goal was fully deserved after the Czechs dominated most of a tense, error-strewn opening 45 minutes.
The second came after Turkey had come out of their shell and attacked for most of the opening 15 minutes of the second half.
Although captain Nihat went close with a flick that flew over Cech's bar, Turkey found themselves 2-0 down when Plasil slid in to steer the ball past Volkan after a fine cross from the right by Libor Sionko.
Czech captain Tomas Ujfalusi said: "All we had to do was hold on to the end of the match and we would have won.
"We didn't do it. After they got their first goal we fell back too far defensively. I'm so sorry. We should have won this match."