Tony Avelar/Associated Press

The San Francisco 49ers have locked down their franchise quarterback as Jimmy Garoppolo has officially signed a new five-year contract worth a reported $137.5 million, per ESPN's Adam Schefter.

Mike Garafolo of NFL Network first reported the new deal. Garafolo said it's the "biggest deal in NFL history on a average-per-year basis."

Matt Maiocco of NBC Sports Bay Area reported the deal includes a total of $74 million in guaranteed money.

Garoppolo posted on Instagram shortly after the reports emerged:

Garoppolo spent the first three-and-a-half seasons of his career with the New England Patriots, making just two starts while primarily serving as the backup to Tom Brady. Despite the limited playing time, the 49ers pulled the trigger on a trade shortly before the trade deadline in exchange for a second-round pick.

After an outstanding showing once he became a regular on the field, general manager John Lynch made it clear this is the long-term answer at quarterback, via Ian Rapoport of NFL.com:

"When you find the right guy at that position, it's really good for your franchise. We believe we've found the right guy. Now the challenge is getting Jimmy signed. We're working hard towards that. We'll see. I think he wants to be with us and we want him there. I think it makes too much sense not to happen. So it's just a matter of getting it done."

The two sides were able to come to an agreement to keep the 26-year-old in San Francisco for the foreseeable future.

Garoppolo has already proved he has what it takes to lead the team to success, turning around what was one of the worst teams in the NFL with a 5-0 record as a starter after the 49ers went 1-10 to start the year. His 1,250 passing yards in his first four starts for his new team are the most in NFL history, according to David Lombardi of The Athletic.

The Eastern Illinois product finished with 1,560 passing yards and seven touchdowns in six games for a 96.2 quarterback rating, which ranked 11th among passers who attempted at least 177 passes.

While he remains relatively inexperienced for someone drafted in 2014, San Francisco has faith in his ability to lead the team back into contention after four years without a playoff appearance.

If the organization surrounds him with an improved offensive line and more weapons, Garoppolo has a chance to be one of the top quarterbacks in the game.