Stoke's unbeaten Europa League run came to an end after they lost at Besiktas, who finished top of Group E.
The Potters took the lead when Ricardo Fuller's strike from 25 yards took a deflection and beat Rustu Recber.
Manuel Fernandes levelled from the spot after Hugo Almeida was brought down by Matthew Upson, who was sent off.
Mustafa Pektemek handed Besiktas the lead with a diving header before fellow substitute Edu's fierce strike sealed victory for the Turkish side.
The scoreline did not accurately reflect Besiktas's dominance against a Stoke side who arrived in Turkey having left their first-choice XI at home, with a last-32 berth already secured.
DID YOU KNOW?
- Stoke's defeat is their first in Europe this season following a run of seven wins & two draws (including qualifiers)
The Turkish team, on the other hand, needed a draw to confirm their spot, and knew defeat against Stoke and victory for Dynamo Kiev, plus a five-goal swing, would see the Ukrainian side qualify instead.
Thanks to heavy investment in the summer, Stoke's 'second string' was an experienced unit, but on the night Besiktas produced markedly the stronger performance.
The visitors were lucky not to be behind before Fuller's strike, with keeper Asmir Begovic making four great saves - from German midfielder Fabian Ernst, Veli Kavlak and twice from Almeida.
But they stunned the lively home support in the Inonu stadium when Fuller took advantage of some poor defending before firing in a shot from 25 yards, which took a deflection off Egemen Korkmaz.
The Jamaican came close to adding a second shortly after the restart, but he failed to get the final touch on the ball after he had charged down keeper Rustu's clearance.
The ball spiralled up and hit the crossbar, but as it bounced down Fuller was unable to turn it home.
With Kiev leading 2-0, Besiktas could not afford to go further behind. Instead, they deservedly levelled in the second half when the spritely Fernandes scored from the spot after team captain Upson had brought down Almeida.
The former West Ham player was shown a straight red by Polish referee Marcin Borski.
Stoke, a man down, now came under even more pressure and, having both gone close with efforts inside the area, Fernandes and substitute Pektemek combined to put Besiktas in front.
This time Fernandes swung in a corner from the right and his team-mate flung himself at the ball to head in from 10 yards.
And in the last 10 minutes, Edu made sure that Besiktas finished top of their group with a sweet angled strike from the corner of the area.
- 01 Rustu
- 03 Koybasi
- 06 Sivok
- 55 Korkmaz
- 04 Fernandes
- 08 Kavlak
- 13 Hilbert Booked
- 18 Uysal (Regufe Alves - 76' )
- 28 Ernst
- 09 Almeida (Edu - 74' Booked )
- 23 Holosko (Pektemek - 46' )
- 99 Gonen
- 05 Toraman
- 27 Sidnei
- 17 Ekrem Dag
- 24 Regufe Alves
- 11 Pektemek
- 33 Edu
- 01 Begovic Booked
- 03 Higginbotham
- 20 Upson Dismissed
- 28 Wilkinson (Pennant - 28' )
- 15 Diao
- 24 Delap
- 32 Arismendi
- 40 Palacios
- 09 Jones
- 10 Fuller Booked
- 33 Jerome
- 27 Nash
- 16 Pennant
- 41 Clarkson
- 44 Dawson