The San Francisco 49ers are locking up starting quarterback Colin Kaepernick long term.  

Kaepernick has received a six year contract extension through the 2020 season. 

The team announced the deal Wednesday. The sides had made it a top priority to get a deal done before the start of training camp for one of the NFL's best young quarterbacks. 

The deal is worth up to $126 million, with $60 million guaranteed.  

Since taking over the starting job from Alex Smith midway through the 2011 season, Kaepernick led the 49ers to their first Super Bowl in 18 years after the 2012 season -- losing by three points to Baltimore, and then to the NFC championship game last season, a three-point defeat to the rival and eventual Super Bowl champion Seattle Seahawks.

The 26-year-old has thrown for more than 5,000 yards with 31 touchdowns and just 11 interceptions in three seasons with San Francisco.