Joe Staley will finish his career in San Francisco.

The 49ers announced Wednesday they have signed the veteran tackle to a two-year contract extension through the 2021 season.

Terms of the deal have not yet been revealed.

Staley, who was entering the final year of his last deal, was set to earn $8.075 million in 2019.

"It was a big deal for me," Staley reporters. "It was something I was very proud of. The opportunity to finish my career in one spot was one of my goals. Honestly, when I came in, it was to play for this one franchise and make a career out of this."

With 12 years in San Francisco under his belt and three more to come, Sta

ley will get his wish.

"When I signed the deal and agreed to terms, I saw Kyle [Shanahan] and John [Lynch] right after and I broke down, I started crying. I don't get emotional like that. I don't look back on my career ever and think of like things and whatever — it's not something I've really done — but this is something that I take pride in, to have the opportunity to play for one franchise for my entire career."

Staley, 34, was selected by the Niners with the No. 28 overall pick of the 2007 draft. He has started all 174 regular-season games he has played in in addition to eight playoff games.

The six-time Pro Bowl and three-time All-Pro selection also ranks fifth in franchise history for the most games played by an offensive lineman (174).