Manchester United will face a play-off to qualify for the last 16 of the Europa League after beating Real Sociedad on Thursday but still finishing second in Group E on goal difference.
The Red Devils needed to win by two goals to leapfrog Real Sociedad at the top of the table and looked on course when Garnacho made it 1-0 on 17 minutes with his first senior goal for the club.
Cristiano Ronaldo should have doubled the Red Devils' lead but wasted a glorious opportunity before David de Gea produced two great saves to preserve his clean sheet.
The second half was more chaotic and ended with Ten Hag throwing on centre-back Harry Maguire in attack in a desperate search for that crucial second strike.
The goal never came which means Man Utd will now face a team dropping out of the Champions League for a place in the knockout round.