SANTA CLARA, Calif. -- The San Francisco 49ers took care of their final piece of big offseason business Wednesday, agreeing to terms with Fred Warner on a contract that will make him the highest-paid off-ball linebacker in NFL history, sources told ESPN's Adam Schefter.

Warner and the Niners agreed to a five-year, $95 million deal that includes $40.5 million guaranteed, sources told Schefter. The $19 million average annual value surpasses the previous high of $18 million per year held by Seattle Seahawks linebacker Bobby Wagner.

Warner's $40.5 million is the second-highest guaranteed total for an off-ball linebacker, trailing only the New York Jets' C.J. Mosley's $51 million, according to ESPN Stats & Information.

The deal comes six days before the 49ers are scheduled to report to training camp and 10 days before they start practice on July 31, which was always viewed as an unofficial deadline for Warner and the team to complete a deal.

Warner, 24, left little doubt that he wanted to get a deal done this past May during organized team activities, when he said he wants "to be a Niner for life."

A third-round pick in the 2018 draft, Warner ranks seventh in the NFL in tackles (366) and is one of two players with 250-plus solo tackles (252) and 15-plus pass breakups (16) in that time, along with Wagner.

Warner finished last season with 125 tackles, a sack, a forced fumble, two fumble recoveries and two interceptions as he earned his first Pro Bowl and All-Pro nods along with the Niners' two most prestigious team awards.

Warner joins tight end George Kittle and left tackle Trent Williams in landing record-setting contracts for their position in the past year. Kittle re-signed just before last year's training camp, and Williams agreed to his deal with the Niners in March.

Getting Warner's deal done now also helps reset the market for his position, as the Indianapolis Colts' Darius Leonard and Chicago Bears' Roquan Smith are also due for lucrative extensions.