Star pass-rusher Danielle Hunter and the Houston Texans have agreed to a two-year, $49 million deal that includes $48 million guaranteed, a source told ESPN's Adam Schefter on Tuesday.

The deal has a maximum value of $51 million, the source said.

In effect, the Texans and Minnesota Vikings are trading their 2023 sack leaders. On Monday, Jonathan Greenard, who led the Texans with 12.5 sacks last season, agreed to a four-year, $72 million contract with the Vikings.

The addition of Hunter will give the Texans a formidable pass-rushing duo of Hunter and 2023 NFL Defensive Rookie of the Year Will Anderson Jr., who had seven sacks in his first season.

Hunter becomes the second star player added on Tuesday by the Texans, who earlier agreed to a trade with the Cincinnati Bengals to acquire running back Joe Mixon.

Hunter, 29, produced arguably the best season of his career in 2023 in defensive coordinator Brian Flores' scheme. He finished with 16.5 sacks and 1,006 snaps, both the highest figures of his career. He also earned consistent plaudits from Flores for his ability and willingness to set the edge in the Vikings' run defense, and along the way led the NFL with 23 tackles for loss.

The 2023 season not only capped a remarkable comeback for Hunter, who missed all of the 2020 season and another 10 games in 2021 because of injuries, but also cemented his flexibility within multiple schemes. Hunter amassed the first 60.5 sacks of his career in five seasons as a 4-3 defensive end under former coach Mike Zimmer.

When he returned from neck and biceps injuries in 2022, the Vikings had fired Zimmer and replaced him with Kevin O'Connell, who preferred a 3-4 scheme. In the following two seasons, Hunter totaled 27 sacks while playing a hybrid outside linebacker position.

Hunter had only 4.5 sacks in his college career at LSU, but former Vikings general manager Rick Spielman viewed him as an ideal edge rusher and made him a third-round pick in the 2015 draft. He had 18.5 sacks while playing a limited role in his first two seasons before becoming a full-time starter in 2017. He signed a five-year, $72 million contract extension before the 2018 season that soon became outdated, ultimately leading to a brief "hold-in" during training camp in 2023.

To get him onto the practice field, the Vikings gave him a slight raise and agreed not to use the franchise tag when his deal expired this spring, setting up his path to free agency.

ESPN's Kevin Seifert contributed to this report.