VIENNA, Austria (AP) — Turkey taught the European Championship another lesson in fortitude Friday night to advance to the semifinals with a 3-1 shootout victory over Croatia.

The Turks needed a tying goal in injury time of the extra period after a 0-0 draw in regulation, just moments after the Croats seemingly had won it. Semih Sunturk, who later scored in the shootout, got the equalizer from just inside the area off a free kick by goalkeeper Rustu Recber from near midfield.

A minute before, Recber's error allowed Ivan Klasnic to score the match's first goal, in the 29th minute of extra time. Recber chased after a ball headed out of bounds, and Luka Modric passed it to Klasnic for a short header.

But the Turks, who rallied with two late goals to beat the Czech Republic and qualify for the quarterfinals, had another dramatic strike in them.

After that, it was relatively easy in the penalty-kick shootout. Modric and Ivan Rakitic shot wide, Turkey made its first three tries, and Recber dived left to save a penalty shot from Mladen Petric to clinch it.

Arda Turan, Senturk and Hamit Altintop scored for Turkey in the shootout. Darijo Srna got Croatia's only shootout goal.

Turkey will face Germany in the semifinals on Wednesday in Basel, Switzerland. Neither team won its first-round group.

Klasnic is the first player to appear in Euros after needing a kidney replacement. He had one donated by his father, and returned to play in the Bundesliga before joining the national team.

Until the dying moments, it was a low quality match marked by defensive caution. The depleted Turkish team restricted Croatia to few opportunities by pressing in midfield and not allowing the Croats time on the ball. And Croatia, which won Group B, showed little of the attacking flair it used to beat Germany in the opening round.

There were a few good chances to score, though. Croatia striker Ivica Olic hit the crossbar in the 19th minute from close range after a low cross from Modric. In the 83rd, Recber, playing for the suspended Volkan Demirel, preserved the shutout when he made a diving one-handed save on a free kick by Darijo Srna.

The Turks were missing four injured players and two under suspension. The veteran Recber, who helped Turkey make the World Cup semifinals six years ago, made the absence of Demirel less painful until his extra-time blunder.

Then he made up for it with his free kick and his work in the shootout.