The deal will keep the 6-foot-3, 259-pounder with the 49ers through the 2017 season.
Contract terms weren't announced, but multiple media reports pegged it at $44.5 million.
The one-time Cincinnati Bengals third-round draft pick has played in 45 games over three years with the 49ers, including 16 starts last season during which he set career highs with 50 tackles and seven sacks.
Brooks has racked up 139 tackles, 20 sacks and one interception over 58 career games with the Bengals and 49ers.
Dog comes home gnawing on human bone
Julius Randle breaks leg during NBA debut