The 34-year-old has signed a two-year deal through to the summer of 2022.
Lazio were believed to be the frontrunners for Silva's signature.
And such as was the surprise over the announcement that Sociedad's website crashed momentarily as people scurried to find more information on the move.
"Real Sociedad has reached an agreement with David Silva for the Canarian footballer to play for the Txuri Urdin team for the next two seasons, until June 30, 2022," read a statement on the club's website.
"The player, who arrives free after passing through Manchester City, will incorporate in the near future to the preseason of the realistic team.
OFFICIAL ANNOUNCEMENT| We are delighted to announce the signing of @21lva. The player joins Real as a free agent until June 30, 2022.#WelcomeDavid#AurreraRealapic.twitter.com/PtqIkt4nJR
— Real Sociedad (@RealSociedadEN) August 17, 2020