ORCHARD PARK, N.Y. >> The Buffalo Bills announced the long-anticipated decision to release Von Miller on Sunday, parting ways with the aging edge rusher whose contract proved too expensive for his dwindling playing time and production.

The move allows the Bills to free up about $8.4 million in salary cap space, which comes close to matching how much the team was projected to be over the limit before the NFL’s new year begins Wednesday. Nevertheless, a portion of Miller’s contract will remain on Buffalo’s books this year and is projected to count more than $15 million against the cap.

The Bills posted a picture of Miller with the words “Thank You Von” in making the announcement on their X account.

The 14-year veteran is the NFL’s active leader in sacks and set to turn 36 in two weeks. Miller avoided being released a year ago by agreeing to take a substantial pay cut to lower his cap number. It’s unclear if the two sides considered a similar contract restructuring this offseason.

Miller expressed optimism he’d remain in Buffalo for a fourth season after the Bills lost to the Kansas City Chiefs in the AFC championship game in January.

“There’s always some stuff that you can work out or something that you can do,” Miller said.

The future is cloudy for a player who enters free agency for just the second time entering what would become his 15th season. His 1291/2 sacks rank 16th — two behind Lawrence Taylor and Leslie O’Neal since sacks became an official stat in 1982.

Miller was the No. 2 pick in the 2011 draft and spent his first 10-plus seasons with the Broncos. He earned NFL defensive rookie of the year honors and appeared in two Super Bowls with Denver, including the Broncos’ win in the 2015 season.