Niners linebacker Fred Warner's lucrative contract has a unique structure, with two deals in one

San Francisco 49ers linebacker Fred Warner became the NFL's highest-paid inside linebacker on Wednesday, but a closer look at the mega-deal illustrates how lucrative the deal really is and could be.

As Mike Garafolo reported, the base value of Warner's deal is five years, $95 million. The extension also includes $40.5 million guaranteed. But that doesn't tell nearly the whole story, thanks to a unique structure that essentially makes it two deals in one.

Here is how:

The "first" deal is a five-year extension in which the final two years automatically void to make it a three-year extension. Under that scenario, it's $54.9 million in new money over three new years -- $18.3 million average. That eclipses the three-year extension Seahawks linebacker Bobby Wagner signed in 2019, which was for $54.0 million ($18.0 million average).

Using the four-year total for Warner's deal, he gets $40.5 million guaranteed of the $58.5 million paid out over the four total years. That's 69 percent of the contract guaranteed, compared to Wagner's 61 percent.

The "second" deal is that the 49ers can buy back the final two years -- after they've voided -- by paying Warner $21.85 million in 2025. Under that scenario, the new money total would become $76.8 million -- $19.2 million average.

If Warner plays out the entire contract, it's a five-year extension for $95 million, which is a $19 million average. That still makes him the highest-paid at his position.

The deal's creative structure provides Warner a ton of security upfront with a record-breaking short-term extension that's nearly 70 percent guaranteed. Plus, it also gives the 49ers a choice to make a few years down the road.

Follow Ian Rapoport on Twitter.