Left-back Hernandez, 20, joined Los Blancos from city rivals Atletico Madrid last summer and went on to make 23 appearances.
Following the arrival of new head coach Julen Lopetegui, the Frenchman has been given the opportunity of more regular first-team football at the Anoeta Stadium.
“Real Sociedad and Real Madrid CF have reached an agreement for the loan of the player Theo Hernandez, who will be tied to the club for the current season. Real Sociedad have also reached an agreement with the French player,” a Real Sociedad statement read on the club’s official website.
“This morning, the defender underwent his medical at the Policlinica Gipuzkoa. The player will be presented in the next days.”
Real Sociedad start the new La Liga campaign away at Villarreal on Saturday.
Real Madrid don’t always get their way. If they did, it would be Max Allegri in the hotseat and not Julen Lopetegui.
As it is, Juventus coach Allegri decided to stick around in Turin, admitting his word to president Andrea Agnelli counted for more than Los Blancos’ advances earlier this summer.
Juve ended up bringing a piece of Real to him thanks to their jaw-dropping move for Cristiano Ronaldo.
The acquisition of Ronaldo has doubtless solidified in Allegri’s mind that he reached the right decision, as he bids to end the Old Lady’s 22-year wait for the Champions League trophy.
“I said ‘no’ to Real Madrid because I made a commitment with the President,” the former AC Milan coach told magazine Stile Mese.
“Therefore, my maximum respect for Juventus and given word were why I rejected the call of Real Madrid, the biggest club in the world and the dream for every coach.
“I’d be a hypocrite if I said I wasn’t honoured by their consideration, but I’m absolutely convinced that I made the right decision.
“Am I a ‘bandiera’ like Buffon or Del Piero? I absolutely don’t want to be equated with them because they’re players who wrote Juventus’ history, whereas I’ve only been here for four years.”
Manchester United were after every defender and got none of them before the Premier League’s transfer window slammed shut – including Real Madrid star and World Cup winner Raphael Varane, according to reports in the British media.
A slew of centre-backs had popped up in connection with United including Harry Maguire, Toby Alderweireld, Jerome Boateng, new Everton signing Yerry Mina and even Atletico Madrid stalwart Diego Godin.
But according to British outlets, including The Times, United chief executive Ed Woodward floated the idea of purchasing Varane while having lunch with Real president Florentino Perez last week.
He was quickly shut down and ultimately no centre-back arrived through the doors of Old Trafford on Thursday night, with the club believing no option represented true value for money.
Jose Mourinho was the manager of Los Blancos when Varane arrived in 2011. The 25-year-old has gone on to appear for the club 233 times, and he was a key member of the France squad that clinched the World Cup in Russia earlier this summer.