Manchester United were denied a place in the Champions League knock-out phase as Michael Lang's late strike secured Basel a memorable, and deserved, victory.
Jose Mourinho's men started Group A with four successive victories and could have qualified without even kicking a ball had CSKA Moscow failed to beat Benfica in the early kick-off.
It still appears a case of when rather if United reach the last 16, but Basel's late 1-0 win means progress is not yet completely certain ahead of the Russians visit to Old Trafford next month.
Mourinho's men still boast a three-point cushion but things could have been so different had his side showed cutting edge in a first half.
Marouane Fellaini saw a header cleared off the line and Anthony Martial's cross hit the post, with Marcos Rojo seeing an outrageous long-range effort deflected onto the bar on his return from a cruciate ligament injury after a 216 days out.
The visitors dominated the opening period but tailed off markedly after the break as Basel repeated their memorable win on United's last visit to St Jakob-Park in 2011.
Lang hit the woodwork as Sergio Romero's goal was met by wave after wave of attacks, with United's defence eventually buckling in the 89th minute as Raoul Petretta's cross was turned home by Lang.
United could have been out of sight had they shown their teeth in the first half.
Paul Pogba, captaining the side for just the second time, was was looking to follow-up his man-of-the-match return against Newcastle with another telling contribution.
The Frenchman's no-look through ball almost led to a 12th-minute opener, only for Romelu Lukaku to be denied by Tomas Vaclik.
United recycled the play and Manuel Akanji had to clear off the line as Fellaini met Daley Blind's cross with a powerful header.
Martial switched on for the closing minutes of an otherwise anonymous first-half display, sending in a sublime cross that hit the post after Fellaini failed to make a telling touch.
Moments later the Frenchman was racing through on goal, making light of Basel's defensive attention to force Vaclik into a save.
There was nothing the Basel goalkeeper could do when Rojo took aim from distance, though. The returning defender's audacious long-range attempt rattled the crossbar thanks to Marek Suchy's intervention.
Martial's fine floated cross gave Lukaku a chance soon after the second half got under way, but Basel were looking brighter and Serey Die went close with a thumping first-time strike.
The front three of Mohamed Elyounoussi, Dimitri Oberlin and Renato Steffen were asking questions of United's backline with increasing regularity.
Basel were pushing for the winner and got it in the 89th minute.
Petretta's threatening low cross just evaded Oberlin under pressure from Rojo, but Lang beat Blind to the cross to direct home at the far post.