Nihat Kahveci scored two late goals to complete a pulsating Turkey comeback against the Czech Republic and secure his side a Euro 2008 quarter-final.
Jan Koller steered in a header to put the Czechs ahead before Jaroslav Plasil slid in to add a second.
Arda Turan slotted in for Turkey to set up a tense finale and Nihat equalised after Petr Cech dropped a cross.
Nihat then crashed in a shot off the bar before Turkey keeper Volkan Demirel was red-carded for a push on Koller.
Tuncay Sanli went in goal as Turkey saw the game out and completed a classic and unlikely comeback to set up a last-eight tie against Croatia.
Cech is regarded a one of the best keepers in the world but his 87th minute clanger was the turning point of the game.
Penalties loomed then before Nihat beat the offside trap and brilliantly spun and sent a right-foot curler in off the underside of the crossbar.
The teams had gone into the match with identical group records and the straight showdown for a quarter-final berth had the Stade de Geneve rocking.
The Czechs seized the early initiative and saw Koller head over from a chipped free-kick by Marek Jankulovski.
Tuncay shot wide from 30 yards for Turkey but the Czechs looked more likely to score and Servet Cetin had to crucially intercept a low Libor Sionko cross with Koller lurking.
Sionko sent a rising shot just high of the Turkish goal and failed to get a toe to a dipping ball as Demirel gratefully gathered.
But Turkey's resolve finally buckled when the Czech pressure was converted into a goal with Koller's 34th minute header, which Demirel could not keep out despite getting a hand to the ball.
Koller had been recalled to the starting line-up after being dropped for the defeat to Portugal and his physical presence and height was a constant menace for the Turkish defence.
He sent another header high while Fatih Terim's side were devoid if ideas and invention as they struggled to find a route through the disciplined Czech's.
Turkey could only do better after the break and so it proved as they came out to rescue their Euro 2008.
Nihat acrobatic half-volley went high but had the element of surprise, while Turan started running at the Czech defence from is left wing slot.
Tuncay headed straight at Cech as Turkey went all out to score but left themselves exposed to the counter-attack.
Koller failed to take advantage when he shot wide before Plasil atoned for the miss when he met Sionko's cross on the half-volley just beyond the far post and sidefooted past Demirel.
Turkey were furious at the goal as they were desperately trying to bring on Emre Asik for injured central defender Emre Gungor, who had been stretchered off.
Jan Polak hit the post as the Czech's missed a chance to put Turkey out of reach and it proved crucial as Turan was found by Hamit Altintop and drove in a shot to make it 2-1 after 75 minutes.
Nihat's predatory instinct for the first and superb finishing for the second then won it for a joyous Turkey, who will be without Demirel for their quarter-final.
Turkey: Demirel, Altintop, Gungor (Asik 65), Cetin, Balta, Topal (Kazim-Richards 57), Aurelio, Turan, Sanli, Nihat, Senturk (Sarioglu 46).
Subs Not Used: Rustu, Zengin, Zan, Emre, Karadeniz, Metin, Boral, Akman, Erdinc.
Sent Off: Demirel (90).
Booked: Topal, Aurelio, Turan, Asik.
Goals: Turan 75, Nihat 87, 89.
Czech Republic: Cech, Grygera, Ujfalusi, Rozehnal, Jankulovski, Sionko (Vlcek 84), Matejovsky (Jarolim 39), Galasek, Polak, Plasil (Kadlec 80), Koller. Subs Not Used: Blazek, Zitka, Kovac, Fenin, Sverkos, Pospech, Baros, Sivok, Skacel.
Booked: Galasek, Ujfalusi.
Goals: Koller 34, Plasil 62.
Ref: Peter Frojdfeldt (Sweden).