Financial terms of the deal were not disclosed but local media reported the contract, which will keep Gore with the team through the 2014 NFL season, is worth $21 million.
"The collective goal all along was to allow Frank the unique opportunity to play his entire career with the San Francisco 49ers, and we are extremely pleased to have accomplished this," Trent Baalke, the 49ers general manager, said in a statement.
"Frank's love for the Bay Area community, play on the field and leadership within the locker room are equaled only by his passion for the game."
Taken in the third round of the 2005 NFL Draft, Gore has been a workhorse in the 49ers backfield rushing for 6,414 yards and 35 touchdowns in six seasons. He also has 270 receptions for 2,283 yards and nine touchdowns.
Since 2005, Gore ranks third in the NFL with 8,697 total yards from scrimmage, fourth in rushing yards and fourth among all running backs in receiving yards.
Gore missed the final five games of the 2010 NFL season with a hip fracture.
(Writing by Steve Keating in Toronto; Editing by Frank Pingue)