Alejandro Garnacho scored the only goal of the game for Manchester United as they ended their Europa League group campaign with a win over Real Sociedad in Spain, but must go through a playoff to reach the next round after qualifying second in Group E table.
The visitors needed to win by a two-goal margin to leapfrog the La Liga side but could only manage one despite their best efforts.
Garnacho, making his second start since impressing on his debut, put United ahead in the 17th minute after being set up by Cristiano Ronaldo. The teenager almost got the second just minutes later but slipped before taking the shot which sent his effort over the bar.
David de Gea then kept United in the contest by denying Andoni Gorosabel and Pablo Marín in the same attack before halftime.
With time running out Erik Ten Hag sent Harry Maguire as a striker but failed to find the needed goal allowing Real Sociedad to finish top on goal differential and reach the last 16 of a European competition for the first time in 20 years.
United, who were beaten by Real Sociedad earlier in the competition, must now face a knockout round playoff in the Europa League against one of the eight third-place finishes from the Champions League group stage which include Ajax, Barcelona, Juventus, Bayer Leverkusen, FC Salzburg, Sevilla, Shakhtar Donetsk and Sporting CP.
Meanwhile, in other results Arsenal, FC Union Berlin, Real Betis, Fenerbahce, Braga, PSV Eindhoven, AS Roma, Trabzonspor, Sheriff Tiraspol, Nantes, Feyenoord, FC Midtjylland and Monaco also earned wins.