SANTA CLARA, Calif. -- Since coach Kyle Shanahan and general manager John Lynch arrived in 2017, the San Francisco 49ers have made a habit of devoting resources to bolstering their defensive line. They did it again Friday when they agreed to a trade with the Denver Broncos that will bring edge rusher Randy Gregory to the Bay Area.
The Niners acquired Gregory and a 2024 seventh-round pick from the Broncos in exchange for a 2024 sixth-round pick, the teams announced.
"Two years ago, when we played them in Dallas, he was as good of a rusher as we had gone against," Shanahan said. "Being able to add a guy like that, we feel he will make our team better, and that's why we didn't hesitate to do it."
One key part of the deal was the economics. As part of the agreement, the Broncos will pay Gregory roughly $10 million for the rest of the season while the Niners will pay him the veteran minimum for that time, sources told ESPN's Adam Schefter. Gregory has three years left on his deal, but none of it is guaranteed beyond 2023.
While the 49ers have around $40 million in salary cap space, their hope is to roll most of that over to future years so they can re-sign key players like wideout Brandon Aiyuk, who is set to play on the fifth year of his rookie deal in 2024.
"That's why we felt extremely good about it," Shanahan said. "Especially making a trade just having to flip sixth and seventh and not hurt anything moneywise. So we feel fortunate to have him on our team."
The deal came together after a week of speculation surrounding Gregory's future with the Broncos. Gregory had not been present at Denver's practice facility after he and his representatives asked for a release earlier in the week, sources told ESPN. Broncos coach Sean Payton acknowledged that a move with Gregory was coming and said moving on from him was "something we felt was just best for our team right now timing-wise," before the Broncos and Niners reached agreement on a deal.
Gregory arrived in the Bay Area on Friday afternoon to meet Shanahan and the team, showing up partway through practice and taking his physical. He was returning to Denver on Friday night and will not play in Sunday night's showdown with the Dallas Cowboys. He will then join the Niners on Monday.
To make room for Gregory on the roster, the Niners are planning to release veteran defensive lineman Kerry Hyder Jr. That move is expected to become official Saturday.
The addition of Gregory had San Francisco's locker room buzzing a bit Friday afternoon. Left tackle Trent Williams, who played against Gregory for many years when he was with the Washington Commanders and Gregory was in Dallas, viewed it as an ideal match.
"He adds everything that we're about," Williams said. "A guy who plays like his hair is on fire, a guy who will give you 100% to the whistle. Obviously, a great pass-rusher, will get after the quarterback, sets the edge in the run game. So everything we're about, he's about. It's a perfect fit."
Gregory, 30, signed a five-year, $70 million deal with the Broncos in March 2022. But he was pulled from the starting lineup against the Chicago Bears last week with outside linebacker Nik Bonitto stepping in. Gregory played 33 snaps against the Bears, finishing with three tackles and a quarterback hit. In four games this season, Gregory has nine tackles and one sack.
For the Niners, Gregory will add to a defensive line that includes end Nick Bosa and tackles Javon Hargrave and Arik Armstead. San Francisco has been seeking a speedy complement to Bosa after the offseason departures of Samson Ebukam and Charles Omenihu in free agency, and Gregory should have the opportunity to contribute opposite Bosa on third down.
Through the first four weeks, Niners defensive ends have combined for just four sacks, three of which came from Drake Jackson in the opening week.
It's another in a long line of bold moves the Niners have made to strengthen their defensive line. In 2017, 2019, 2020 and 2022, the Niners spent their first pick in each draft on a defensive lineman. They have also signed Bosa, Hargrave and Armstead to lucrative contracts and traded a second-round pick for end Dee Ford and signed him to a big contract in 2019.
"It's been important for us to build it up front through the D-line, and Kyle and John have shown that throughout the years, investing up front," Armstead said. "And that's how we believe in building our team is building up front and especially on the D-line. ... With that, we feel that sense of responsibility to go out there and help and win our team ballgames. So we take pride in that. They invested in us, and we want to return that investment and go out there and dominate games."
Over nine seasons with the Cowboys and Broncos, Gregory has 19.5 sacks and 81 pressures. He has never played a full season because of injuries and 54 games lost to suspensions for violating the NFL's substance abuse policy.
Shanahan said the Niners did their research on Gregory's suspension history before making the deal.
"You look into all that stuff always," Shanahan said. "But you always judge a guy when you get to know him ... but there's a lot of people I know very well who speak extremely high of him. I'm excited about the person we got and the character of the guy from what I've been told from everyone who knows him. We loved the tape. I know he's messed up at times in the past, but from the type of person I've been told that he is, we're really excited to have him here."
ESPN's Jeff Legwold contributed to this report.