The Denver Broncos and defensive end Randy Gregory have agreed on a $70 million, five-year contract that will prevent the Dallas Cowboys from keeping one of their top targets in free agency, a person with knowledge of the deal said Tuesday.

Gregory's contract includes $28 million guaranteed. The person spoke to The Associated Press on condition of anonymity because the deal can't be announced until Wednesday when the NFL's business year begins.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

The 29-year-old Gregory has had a suspension-filled seven years in the NFL but was coming off a productive and drama-free season. The Cowboys hoped the goodwill built in standing by a troubled player would lead to a return.

Gregory chose the Broncos instead.

The addition of Gregory comes after Denver traded Von Miller to the Los Angeles Rams during the 2021 season. The Broncos sent 2021 sacks leader Shelby Harris to Seattle in the trade that landed quarterback Russell Wilson.

Harris and Gregory both had six sacks last season. Gregory matched his previous career high from 2018.

In this photo made Tuesday, June 8, 2021, Dallas Cowboys defensive end Randy Gregory (94) walks the field during an NFL football team practice, in Frisco, Texas. Gregory isn't ashamed of a suspension-filled past that nearly derailed his NFL career, just maybe a little tired of it being the focus of his story. (AP Photo/LM Otero)

In this photo made Tuesday, June 8, 2021, Dallas Cowboys defensive end Randy Gregory (94) walks the field during an NFL football team practice, in Frisco, Texas. Gregory isn't ashamed of a suspension-filled past that nearly derailed his NFL career, just maybe a little tired of it being the focus of his story. (AP Photo/LM Otero)

Dallas took a chance on Gregory in the second round of the 2015 draft after the former Nebraska standout tested positive for marijuana at the NFL combine. The first of Gregory's four substance-abuse suspensions came after his rookie year. He returned from an indefinite suspension in 2020 after sitting out all of the 2019 season.

The Broncos entered the offseason needing help on the defensive line, and the need grew with the trade of Harris. Miller hinted at pining for a return to Denver on social media after winning a Super Bowl with the Rams. Miller was the Super Bowl MVP when the Broncos beat Carolina to finish the 2015 season.

CLICK HERE TO GET THE FOX NEWS APP

Dallas is bringing back top defensive end DeMarcus Lawrence on a new contract that lowers his salary cap impact. The Cowboys figured they would use some of the cap savings on Gregory. Instead, they might have to consider other veterans. Help could come early in the draft as well.