Brandon Crawford will remain the Giants' shortstop through at least the 2023 season.
Crawford and the Giants agreed to a two-year, $32 million contract on Friday, the team announced.
Stay in the game with the latest updates on your beloved Bay Area and California sports teams! Sign up here for our All Access Daily newsletter.
The extension has a base salary of $16 million in 2022 and 2023. Before signing this deal, Crawford was scheduled to be a free agent this offseason.
Crawford was drafted by the Giants in the fourth round of the 2008 MLB Draft, and this extension makes it more likely that he will stay in San Francisco for the remainder of his career.
The two-year deal also is a hometown special for the 34-year-old Bay Area native who was born in Mountain View and attended Football High School in Pleasanton. He also grew up a Giants fan.
This season, Crawford is batting .296/.364/.540 with 97 hits, 19 home runs and 69 RBI.
San Francisco Giants
Find the latest San Francisco Giants news, highlights, analysis and more with NBC Sports Bay Area and California.
Crawford also is the franchise’s all-time leader in games played at shortstop, surpassing Hall of Famer Travis Jackson earlier this season on June 8 which was his 1,326th game at the position for the Orange and Black.
Crawford was a big part of two World Series championships during his 11 seasons with the Giants, helping his hometown team bring home the hardware in 2012 and 2014.
RELATED: Webb pitches gem, nearly hits slam as Giants blank Rockies
Crawford has earned three All-Star selections, the most recent one being this season, won three Gold Glove Awards and a Silver Slugger.