Adam Schefter says that Matthew Stafford's new contract will be north of $25 million per year on average and explains how it'll help reset the QB market as players like Kirk Cousins, Drew Brees and Aaron Rodgers are nearing the end of their contracts. (1:14)

ALLEN PARK, Mich. -- Matthew Stafford will become the highest-paid player in NFL history with the five-year deal he has agreed to with the Detroit Lions, sources told ESPN on Monday night.

The deal will have an average annual value of $27 million, a source said, putting Stafford ahead of the five-year contract that pays $25 million annually to Oakland Raiders quarterback Derek Carr, which Carr signed last month.

A source told ESPN's Adam Schefter that Stafford's deal is expected to guarantee him a record $92 million, including a $50 million signing bonus. The previous record for guaranteed money issued to an NFL player was $87 million for Andrew Luck of the Indianapolis Colts.

Under the deal, Stafford will be guaranteed $60.5 million at signing and $86 million by the start of Year 2 of the contract, which starts next March, a league source told Schefter. The full $92 million is guaranteed upon Year 3, the source told Schefter.

The Lions announced the five-year deal Monday night but did not disclose financial terms. The deal keeps the 29-year-old Stafford, the Lions' franchise leader in almost every passing category, with the team throughout the prime of his career.

Top Lions receiver Golden Tate and Stafford's wife, Kelly, took to Instagram to congratulate the quarterback.

When daddy and mommy whispered to us we would be spending 6 more years in detroit... hope y'all are as excited as we are! #golions #thankyoudetroit #home A post shared by Kelly Stafford (@kbstafford89) on Aug 28, 2017 at 7:37pm PDT

Stafford made $110,778,969 in his first eight seasons with the Lions, according to Spotrac, and was due another $16.5 million in cash for this season before signing the extension. It's not immediately clear whether that number will change with the extension agreement.

In April, Stafford made it clear he wanted to remain with Detroit. He and his wife lived in the area year-round while she was pregnant, and she gave birth to twin daughters Sawyer and Chandler in March.

The Lions and Stafford made that long-term possibility a reality Monday. This deal won't necessarily be Stafford's last, either. When it was suggested in April that he is past the midway point of his career, he scoffed a bit and said he wants to continue playing for a long time.

Stafford was the No. 1 overall draft pick out of Georgia in 2009, and he was a star at Highland Park High School near Dallas, where he was a teammate of Los Angeles Dodgers pitcher Clayton Kershaw -- who just happens to be the highest-paid player in Major League Baseball this season at $33 million.

Stafford has started 109 games for the Lions, compiling a 51-58 record. After an injury-plagued first two years in Detroit, Stafford has started every game at quarterback for the Lions since the start of the 2011 season.

He has completed 2,634 of 4,285 passes (61.5 percent) for 30,303 yards, 187 touchdowns and 108 interceptions. He has been sacked 242 times, has thrown for 1,515 first downs, and owns a career passer rating of 86.8. He has also rushed 242 times for 851 yards and 14 touchdowns.

Stafford has posted three of the best seasons of his career under Lions head coach Jim Caldwell, including a Pro Bowl year in 2014 and two playoff berths. Under Caldwell, Stafford has had three of his four best completion percentage years and the three lowest interception totals of his career (when he has played more than three games).

Stafford has already become a top-50 quarterback, statistically, in NFL history, ranking No. 39 in completions, No. 47 in attempts, No. 44 in yards, No. 49 in touchdowns and No. 23 in passer rating.