First-half goals from Rafik Djebbour and David Fuster gave Olympiakos a comfortable halftime lead. Yossi Benayoun pulled a goal back in the 57th minute as the hosts tired in the second half, and Francois Modesto clinched it with the third in the final minute.
Olympiakos thought it had done enough to advance to the last 16, until the team and fans were instantly deflated when they heard of Marseille’s stunning comeback win at Dortmund to snatch the runner-up spot to Arsenal in Group F.
Arsenal manager Arsene Wenger rested free-scoring Robin van Persie and other star players, having already secured top spot in the group, and his side lost the initiative early at Karaiskaki Stadium.
Djebbour took a well-timed swerve past goalkeeper Lulasz Fabianski in the 16th minute, leaving the Algerian striker no trouble slotting the ball home.
Ten minutes later Fabianski was injured and carried off. But replacement Vito Mannone fared little better, slipping as he returned from a clearance to let Fuster add a second for Olympiakos with a left-footed lob in the 36th.
The Greek champion pressed Arsenal into making successive mistakes. Swedish defender Olog Mellberg returned from injury to play a key role.
The London side was quiet for most of the match, with Benayoun firing wide in the area in the 31st.
A header from Mellberg hit the crossbar in the 47th, and Modesto headed over an open goal in the 58th.
Olympiakos goalkeeper Balasz Megyeri did well to deny Arsenal substitute Tomas Rosicky a goal in the 74th, plucking the ball away from the Czech midfielder in a late attacking spell from the visitors.