Olympiacos have dropped into the Europa League despite defeating Swedish outfit Malmo 4-2 in the final group match of their Champions League campaign.
The hosts were first to threaten as midfielder David Fuster let fly from 25 yards in the fifth minute, forcing visiting goalkeeper Robin Olsen into a textbook save.
Olsen was called into action again one minute later, pulling off an impressive reaction stop to thwart Pajtim Kasami on the rebound at point-blank range.
Olympiacos broke the deadlock with 23 minutes played when a throw-in caused chaos in the Malmo box and Fuster capitalised on the confusion by bundling the ball home at the far post.
The Greeks were in control for much of the first period, but suffered a scare in the 38th minute when Delvin N'Dinga almost headed into his own net following a Malmo throw.
Olympiacos continued to apply pressure in the second period, but they were left stunned when Malmo pegged them back with their first shot on target, substitute Simon Kroon capping off a blistering counter-attack with a neat finish moments after coming on.
The 1-1 scoreline flattered the visitors, but the home side restored their advantage in the 63rd minute as Argentine striker Alejandro Dominguez beat Olsen with a half-volley from the edge of the box.
Victory for Olympiacos would have been virtually meaningless as Juventus's draw with Atletico Madrid in the other Group A fixture condemned them to the Europa League, and insult was added to injury when their lead was cancelled out for a second time in the 81st minute.
Malmo's second was almost a carbon copy of their opener, with Markus Rosenberg emerging the man to round off the counter-attack with a cool finish on this occasion.
There was a late goal rush for the hosts as Konstantinos Mitroglou and Ibrahim Afellay both found the net in the final four minutes, but Juve's goalless draw with Atletico consigned them to third place in the group's final standings.