Switzerland missed out on a top-two finish in Euro 2020 Group A on goal difference despite a 3-1 victory over Turkey in Baku on Sunday.
Vladimir Petkovic's side knew nothing but a win would be good enough if they wanted to qualify for the last 16 with a second-placed finish in the group, and the Swiss were sent on their way by first-half goals from Haris Seferovic (6) and Xherdan Shaqiri (26).
With Italy leading 10-man Wales 1-0 in Rome, confidence would have been high in the Switzerland camp on reeling in Rob Page's side, but Irfan Kahveci's stunning strike (62) was a huge blow to the Swiss' last-16 chances.
Shaqiri (68) did restore his side's two-goal advantage but there were to be no more goals in Baku, while Wales held on for a 1-0 defeat to secure their passage to the knockout stages.
However, all is not lost for Switzerland, who now have to wait to see if they qualify from third place. But for Turkey, it's the end of their tournament after three straight group stage defeats.
- How the teams lined up | In-depth stats and analysis
- Group A standings | Euro 2020 fixtures and schedule | Euro 2020 gossip column
How Shaqiri and Zuber inspired Switzerland to victory...
Switzerland would have wanted a fast start and that's what they got when Seferovic's low strike put them ahead in the sixth minute, hushing the raucous Turkish crowd in the process.
Steven Zuber picked out Seferovic, who placed his shot low beyond Ugurkan Cakir into the far bottom corner from the edge of the box to hand his side the perfect start.
Switzerland didn't have it all their own way and they needed goalkeeper Yann Sommer to pull off four big saves in the first half, three of them to deny full-back Mert Mldr.
Switzerland: Sommer (8), Elvedi (7), Akanji (7), Rodriguez (7), Widmer (7), Freuler (6), Xhaka (7), Zuber (8), Embolo (7), Seferovic (8), Shaqiri (9).
Subs: Gavranovic (n/a), Vargas (n/a), Mehmedi (n/a), Benito (n/a), Mbabu (n/a).
Turkey: Cakir (7), Celik (6), Demiral (7), Soyuncu (6), Muldur (7), Tufan (6), Under (7), Calhanoglu (6), Kahveci (7), Ayhan (6), Yilmaz (5).
Subs: Yokuslu (6), Yazici (6), Karaman (n/a), Kokcu (n/a), Tokoz (n/a).
Man of the match: Xherdan Shaqiri.
It got even better for Switzerland midway through the first half and Zuber played his part again. He rolled the ball into the path of Shaqiri, who had time and space to curl it into the top-right corner, leaving the goalkeeper no chance.
Turkey looked lost but they were given a lifeline after the break, Kahveci scoring a spectacular goal of his own, curling the ball past Yann Sommer from the edge of the penalty area.
The stunning strike gave the pro-Turkey crowd a lift, but Switzerland soon restored their two-goal advantage.
- Switzerland make two changes from the side that lost 3-0 Italy with Silvan Widmer and Steven Zuber replacing Fabian Schar and Kevin Mbabu.
- Turkey made three changes from the defeat against Wales with Merih Demiral, Mert Muldur and Irfan Kahveci in for Umut Meras, Okay Yokuslu and Kenan Karaman.
Zuber produced a third assist of the game, picking out Shaqiri from the left, and the Liverpool forward produced an emphatic finish to give Switzerland hope again.
With Wales still trailing 1-0 in Rome, Switzerland needed to find two more goals to secure a place in the last 16, but they did not come, leaving Switzerland to wait on their place in the knockout stages.
What the managers said...
Switzerland boss Vladimir Petkovic: "I'm very pleased. The team did what they needed to. I felt we produced a good performance over 90 minutes. The aim for us remains to qualify for the last 16.
"Of course we're a little disappointed [at finishing third], but we knew what we had to do and we did that tonight. Now we have to wait and see."
"I think we showed as a team what we're capable of. We created a lot of chances and we could have defended a bit better for Turkey's goal, but I'm pleased with the players."
Turkey boss Senol Gunes: "We are aware that we were not good enough. The first match had such a negative effect on my players. That can happen. But those players will play for Turkey for many years and they will succeed like before."
Man of the match - Xherdan Shaqiri
The Liverpool forward controlled the game for Switzerland.
He was given the freedom to roam all over the pitch and caused Turkey all sorts of problems in the 76 minutes he was on the pitch.
The 29-year-old scored two exquisite goals, the first a long-range stunner before an emphatic finish gave Switzerland hope of overhauling Wales.
It was not quite to be for the Swiss and Shaqiri, who is now Switzerland's outright top goalscorer at major tournaments, with his second goal this evening his seventh for his country at either the World Cup (4) or European Championships (3).
But their third-place finish and tally of four points should be enough for a last-16 place, and whoever Switzerland come up against will have to pay close attention to Shaqiri.
Opta stats - Goals flow for Swizterland, but not enough
- Switzerland scored more than twice in a European Championship game for the very first time - indeed, 25 per cent of their total Euros goals in their history came this afternoon against Turkey (3/12).
- Haris Seferovic and Xherdan Shaqiri both scored from outside the box, the first Swiss players to do so at any Euros, with each of their nine goals in the competition before today coming from inside the area.
- 41 shots were attempted in this afternoon's match between Switzerland (22) and Turkey (19), the joint-most in a group stage game at the European Championships, matching that of Netherlands v France in 2008, Spain v Germany in 1984 and England v Spain in 1980.
- Alongside Denmark (in 1988 and 2000), Turkey have become just the second nation to lose all three group-stage matches at more than one edition of the Euros, having also suffered this fate at their debut tournament in 1996.
Switzerland will have to wait to see if their tally of four points is enough to qualify for the last 16 as one of the four best third-placed sides.
Meanwhile, Turkey's tournament is over as they exit at the group stage.