Stoke City have failed to finish top of Europa League Group E after a 3-1 defeat at Besiktas.
The Premier League side, who had already qualified for the knockout stages of the competition, suffered their first defeat of the campaign in Turkey.
The Potters took the lead against the run of play in the 28th minute when Ricardo Fuller's 20-yard effort deflected in.
Fuller could have doubled his side's lead soon after, but his looped shot bounced back off the crossbar. The striker went in bravely for the rebound, but couldn't connect with the ball.
The Turkish club drew level ten minutes into the second half when Almeida was fouled in the area by Matthew Upson. The defender was dismissed for the challenge, while Fernandes smashed in the resulting penalty kick.
Besiktas went ahead with 15 minutes to play as Mustafa Pektemek was allowed to head in from a corner after he had escpaed the attention of Danny Higginbotham.
The match was put out of Stoke's reach in spectacular style after Edu fizzed a left-footed shot into the far corner past the reach of the outstretched Asmir Begovich on 82 minutes.
Besiktas have qualified top of the group with their win.