The deal is worth $26.6 million and includes $17.1 million in guarantees, according to NFL.com.
The Raiders originally placed their franchise tag on Branch on March 1 and the former fourth-round pick signed the tender in May in order to join the team's offseason workouts under new coach Dennis Allen.
The sides had until July 15 to reach a long-term deal with Branch or he would have been forced to play the 2012 season under the $6.2 million tender.
Branch, a fourth-round pick in 2008, has started every game the past three seasons and led the Raiders in tackles the past two years. He had 78 solo tackles, one sack, one interception, four passes defensed and one fumble recovery last season.
Branch's 327 total tackles over the past three seasons are the second most of any NFL defensive back, trailing only Indianapolis' Antoine Bethea, who has 340.
Branch also was much improved in pass coverage, cutting his completion percentage against from 67.4 percent in 2010 to 55.7 percent last season, according to STATS LLC, as the Raiders often used him as a cornerback in nickel packages.
Branch and free safety Michael Huff will anchor an overhauled secondary in Oakland this year. After years of running a defense premised on aggressive man coverage under late owner Al Davis, the Raiders are expected to use more blitzes and zone coverages this season.
Information from The Associated Press contributed to this report.