The Denver Broncos and Demaryius Thomas have agreed to a long-term deal just minutes before the 2 p.m. deadline.

Adam Schefter of ESPN first reported that the deal is worth $70 million with $43.5 million in guarantees. Thomas and the Broncos have been working towards this solution for months and almost ran out of time.

The deal was first reported with less than a half-hour before the deadline for Thomas to sign his franchise tagged contract of just under $13 million for the 2015-16 season. Days ago the two sides were reportedly far apart on yearly salary and guaranteed money. Some reports stated that Thomas was seeking no less than his fellow Georgia Tech alum, Calvin Johnson’s $16 million per season contract he signed in 2012. However, the two sides compromised just before it was too late.

“We are thrilled to reach a long-term contract agreement with Demaryius Thomas,” John Elway stated in a press release Wednesday afternoon. “He has developed into one of the top wide receivers in the NFL, and making sure he remained a Denver Bronco was a significant priority for our team. Demaryius is a special talent and an elite player who has also become a team leader during his five NFL seasons. We are very much looking forward to him playing a major role in the success of the Broncos well into the future.”

Albert Breer of NFL network reported that the Broncos had changed the offer several times to try and accommodate the 6-foot-3, 229 pound receiver. It seems that the tipping point was fellow NFL franchise-tagged, Dez Bryant’s new contract. His deal was reported just a matter of minutes earlier in the day.

Bryant, according to Ian Rapport of NFL Network, received a very similar contract of five years, $70 million and $45 million guaranteed. Both players have earned the big contracts with gaudy numbers the past few seasons. While Thomas has more catches and 100-yard games, Bryant has slightly more touchdown receptions. Both rank in the top three of every major statistically receiving category the last three seasons.

Thomas was clearly looking to be paid more than Mike Wallace, who before today stood as the second highest paid receiver in the NFL at a $12million per year average, $30 million guaranteed. The guaranteed money also was a big issue for Thomas. The reported $43.5 million guaranteed secures his future and allows him to concentrate on learning Gary Kubiak’s new system and proving he is worth the dollars long term.

Also looming for the Broncos is the fact that Von Miller will present a similar situation for the team next year. Now that Thomas is signed they have options as to what to do with Miller. He will be an unrestricted free agent in 2016 and the team will have to decide if they want to franchise tag him at close to $14 million per year or sign him long-term. The Kansas City Chiefs signed Justin Houston to an enormous contract today worth $101 million, $32.5 fully guaranteed. That will factor in heavily into the Bronco’s negotiations next season.

The deal appears to benefit both parties after another race with the deadline clock. Thomas has his financial security while the Broncos and Peyton Manning have their offensive security. The contract is enormous but it landed where Thomas’s talent lies, in the top three of wide receivers. Now the team can continue to focus on the changes between the lines of the football field, instead of on the lines of contracts.

Email Sam at [email protected] and follow him on Twitter @SamCowhick.