Manchester United beat hosts Real Sociedad 1-0 on Thursday but the Spanish side finished top of Europa League Group E on goal difference and the English team will go into the knockout round playoffs.
Alejandro Garnacho scored his first goal for United after 17 minutes when Cristiano Ronaldo played him through on goal with a nice pass, and the 18-year-old placed the ball into the corner of the net.
"I am really happy with his performance: he was a threat, he scored a goal and did well defensively. It was a great finish, a great attack and really enjoyable," manager Erik ten Hag told BT Sport.
Ronaldo had a chance to double the lead after 42 minutes when he intercepted a defensive pass deep into Sociedad's half, but his lob went just over the bar.
Sociedad could have equalised one minute later, but Pablo Marin's volley from outside the box was superbly saved by keeper David De Gea.
United needed one more goal to overtake Sociedad in the standings on goal difference but they struggled to create clearcut chances in the second half.
"You do not always get what you deserve. In the first game there was a penalty that we didn't think was a penalty, but today we won. There are some positives: Garnacho, Donny (van De Beek) back in the team. We scored a good goal but unfortunately we didn't get the two we needed," Ten Hag said.
Sociedad topped the group on 15 points, the same as United. Moldova's Sheriff Tiraspol will go into the Europa Conference League after finishing third following their 1-0 home win over Omonoia Nicosia.
Feyenoord beat Lazio 1-0 to finish top of Group F after a thrilling final round of matches that left all four teams on eight points. Danish side Midtjylland grabbed second place after beating Austria's Sturm Graz 2-0 and Lazio go into the Conference League after ending up third.
Group G winners Freiburg drew 1-1 at Qarabag and French side Nantes will go into the knockout round playoffs after a 2-0 win at Olympiakos.
Group H winners Ferencvaros qualified for the round of 16 despite a 1-0 loss at Trabzonspor. AS Monaco will enter the playoffs after beating Red Star Belgrade 4-1 and Trabzonspor took the Conference League spot.