The midfielder, who moved to the Santiago Bernabeu just two years ago, will return to his former club having struggled for game time during his spell at the Spanish giants.
He had been linked with a move to Liverpool and Southampton, however David Moyes has won the race to make him his second signing of the summer.
SUBMIT AN ARTICLE
Apply to become a GMS writer by signing up and submitting a 250 word test article: http://gms.to/haveyoursay5
The Scot has already swooped for ex-Elche forward Jonathas having found his attempts to sign new Liverpool striker Danny Ings from Burnley fall short.
Illarramendi regularly found his path to the first team thwarted, and had his presentation to fans marred by shouts from spectators for the club to sign Gareth Bale.
With Sami Khedira and Luka Modric already ahead of him in the pecking order, the arrival of Toni Kroos from Bayern Munich last summer restricted his chances of regular football even more.
Lucas Silva then arrived from Brazilian club Cruzeiro in January, with the signing of Mateo Kovacic from Inter Milan a few weeks ago the final straw.
However despite his struggles he returns to his former club with a Champions League medal having helped Carlo Ancelotti win La Decima in 2014.
Ancelotti's popularity amongst the players was high, yet Florentino Perez still saw fit to give former Chelsea and Liverpool boss Rafael Benitez a chance in the job this season.
Illarramendi now has the perfect opportunity to stake his claim for a place in the Spanish national side ahead of the European Championships in France next summer.
His best form may also be enough to help Sociedad build on their 12th-placed finish with Moyes keen to propel them back into the La Liga top ten.