Turkey 3 Czech Republic 2
Nihat Kahveci scored twice in a dramatic final four minutes to earn Turkey second spot in Group A and a quarter-final clash with Croatia after a Euro 2008 thriller in Geneva.
The Czechs looked home and dry in the 61st minute when Jaroslav Plasil added to Jan Koller’s first-half opener to put his team 2-0 ahead.
But in an amazing end to the winner-takes-all match, Arda Turan halved the deficit in the 75th minute before Nihat came to the party.
The Turkey captain drew the sides level in the 86th minute when he took advantage of a ghastly error by Czech goalkeeper Petr Cech to poke home into an empty net.
And the Villarreal striker sparked delirium among the Turkish fans when he curled home an unstoppable winner with two minutes remaining.
There was still time for Turkey goalkeeper Volkan Demirel to receive his marching orders for an off-the-ball incident involving Koller, but his team held on to record their first win over the Czechs in 12 attempts.
Group B winners Croatia now lie in wait for the Turks in Vienna on Friday.
A penalty shootout loomed if the match had ended as a draw after 90 minutes but it looked long odds against that prospect the way Turkey played in the first half.
They were dreadful and looked a team gripped by nerves as they failed to trouble Cech in the opening 45 minutes.
The more experienced Czechs, semi-finalists at the Euros four years ago, looked assured from the off and should have been more than a goal ahead at the interval.
Koller, back in the starting line-up after being benched for the 3-1 defeat to Portugal, was at the hub of most of his team’s attacks and he headed Marek Jankulovski’s free-kick over the bar when well positioned in the 10th minute.
Turkey’s Brazil-born midfielder Mehmet Aurelio had moments earlier picked up a booking which will rule him out of the quarter-final.
Marek Matejovsky, who was carried off on a stretcher in the 37th minute, drew a decent save out of Volkan while Servet Cetin made a great last-gasp clearance to prevent Koller scoring a simple tap-in.
It was one-way traffic, the ever-dangerous Libor Sionko firing just over from the diagonal in the 25th minute as the nervous Turks continued to relinquish possession.
The goal the Czechs deserved came nine minutes later, Juventus full-back Grygera galloping down the right and crossing for Koller to power home a trademark header in emphatic style from eight yards out.
That was his 55th international goal and the Nurnberg targetman, who will quit playing for his national team after the Euros, almost made it 56 when he nodded over another Jankulovski set-piece.
The Turkey players trudged off heads down at the half-time whistle and would no doubt have been given the hairdryer treatment by coach Fatih Terim in the dressing room.
Terim replaced anonymous striker Semih Senturk with midfielder Sabri Sarioglu at the interval, and the change paid dividends as the Turks began the second half well under rainy skies.
Nihat volleyed over acrobatically two minutes in while Tuncay Sanli deflected a free-kick straight at Cech.
The Czechs suddenly looked tentative but Plasil settled any nerves with their second just after the hour mark.
Moments earlier, Koller had sidefooted wastefully wide with just Volkan to beat but Osasuna midfielder Plasil did much better when he got on the end of Sionko’s right-wing cross to prod home at the far post.
The goal initially took the wind out of Turkey’s sails and midfielder Jan Polak almost made it 3-0 when he sidefooted Sionko’s cross against the post from 10 yards.
But it was not all over. Arda set up a tense final 15 minutes when he slid home a low finish past Cech after pouncing on a Hamit Altintop centre.
And after Servet somehow headed wide from close range in the 81st minute, Cech spilled a deep cross from the right, allowing Nihat to force home the equaliser into an empty net with three minutes remaining.
Worse was to come for Cech when barely a minute later, Nihat made the most of some dreadful defending to latch on to a through-ball and curl home a superb finish off the bar.
In the final few seconds, Volkan saw red for an incident involving Koller but Turkey held on for a dramatic victory.