Manchester United and Manchester City suffered ignominious Champions League exits on Wednesday as Basel, Olympique Lyon, Napoli and CSKA Moscow grabbed the last four spots in the knockout round.
Needing victory over last year's runners-up in their jam-packed St. Jakob-Park stadium, Basel battled to a 2-1 win to jump ahead of United into second place in Group C and send the English champions into the Europa League.
City, running riot at the top of the Premier League, beat already-qualified Bayern Munich 2-0 in their final Group A match but it proved in vain for the competition's newcomers as Napoli won 2-0 at Villarreal to grab second place.
Like French rivals Marseille the previous night, Lyon produced the most stunning turnaround as they thrashed Dynamo Zagreb 7-1 away to snatch second place in Group D from Ajax who lost 3-0 at home to Real Madrid.
Lyon, for whom Batefimbi Gomis scored four times, and Ajax finished on eight points and level on head to head after two 0-0 draws between the sides, but the French side's onslaught in Croatia meant they squeezed through on a better goal difference.
Russian's CSKA began the evening bottom of Group B but their 2-1 victory at already-qualified Inter Milan meant they rose to second after Lille and Trabzonspor played out a 0-0 draw in northern France when victory for either team would have put them into the first knockout round.
Basel enjoyed one of the greatest nights in their history as United failed to reach the knockout stage for only the third time in 17 attempts.
Marco Streller struck in the ninth minute to put the hosts ahead and Alexander Frei scored late in the second half before United pulled one back through Phil Jones to set up a nerve-jangling finale to a gripping clash.
Benfica secured top spot in the group with a 1-0 victory over Romanians Otelul Galati.
Second-half goals by Gokhan Inler and Marek Hamsik were enough to secure Napoli's passage at the expense of Manchester City, the Italians finishing on 11 points to the 10 of City who will join United in the Europa League.
Chelsea, Olympique Marseille and Zenit St Petersburg booked their last-16 berths Tuesday to join Bayern Munich, Inter, Benfica, Real Madrid, Barcelona, Arsenal, Bayer Leverkusen, APOEL Nicosia and AC Milan in next week's draw.