Januzaj, 22, was told he could find another club this summer by United manager Jose Mourinho.
He returned from an unsuccessful campaign on loan at Sunderlandand was left out of Mourinho’s squad for the pre-season tour of the United States.
Januzaj has also had a stint on loan at Borussia Dortmund in 2015-16.
Just as they did with Memphis Depay, United have included a buy-back clause in the deal that will allow them first option to re-sign Januzaj if he revives his career in Spain.
That clause insulates them from the possibility of having to pay a massive fee to bring him back to Old Trafford, something they did not manage when they paid a world-record fee to bring Paul Pogba back to the club.
Januzaj joined United from Anderlecht when he was 16 and broke into the first team in 2013 during David Moyes’ ill-fated spell in charge.
Deemed good enough to take Ryan Giggs’ number 11 shirt, Januzaj signed a five-year contract extension that was not due to expire until 2018.
Real Sociedad finished sixth in La Liga last season and will compete in the Europa League group stage in 2017-18.