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.

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.

Copyright 2014 by The Associated Press. Any commercial use or distribution without the express written consent of The Associated Press is strictly prohibited.