After spending a season on loan at Anoeta during the 2011-12 season, the Mexican forward signed a permanent deal with the Liga side, but Arsenal were thought to have retained an option to buy back the player for a set fee written into the deal.
Vela has scored 47 goals for the club during his time in Spain, including 21 last season, and reports linked the Premier League side with a move for the player during the close-season.
However, that deal will not go ahead after Sociedad confirmed they had agreed a contract with the player until 2018 and reached a deal with Arsenal to remove the clause.
"Real Sociedad have reached an agreement with Arsenal which will allow Carlos Vela to continue at the club on a permanent basis," they announced on Tuesday.
"The player meanwhile, has signed a contract extension which ties him to Real Sociedad for the next four seasons.
"The player's previous contract was due to expire in June 2016. The Mexican striker has now formally signed his new contract."
Arsenal bought the striker in 2005 but work permit restrictions saw him loaned to Spain before making the first of his 62 appearances in August 2008.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.