The 28-year-old midfielder, who previously had a contract running until 2013, began his career in the Spanish side's youth academy in 1997.
"Real Sociedad and Xabi Prieto have reached an agreement to renew his contract," reads a statement on the club's official website.
"The new agreement is for four years and means the midfielder will be tied to the club until June 30, 2017."
Having made his debut for La Real's first team in 2003, Prieto has since made over 250 appearances for the club and has now set his sights on ending his career with them.
"Of course I would like to retire at Real and today I have taken a step further toward that dream," he enthused.
How do you stay up to date with football when on the move? With http://m.goal.com – your best source for mobile coverage of the beautiful game.