San Francisco 49ers defensive end Nick Bosa. Bill Streicher-USA TODAY Sports

San Francisco 49ers fans can finally exhale.

The 49ers and Nick Bosa resolved their contract dispute by reaching agreement on a new deal.

The contract is for $170M over five years, with $122.5M guaranteed, according to ESPN’s Adam Schefter. The contract makes Bosa the highest-paid defensive player in NFL history.

Bosa had been holding out throughout training camp in hopes of a deal. The Niners maintained confidence that a deal would be reached; it was just a matter of agreeing to terms.

Bosa was seeking to become the highest-paid defensive player in the league. Prior to his deal being agreed to, it was Aaron Donald who held that honor at $31.7M per year. Bosa is set to average $34M per year.

Bosa is the reigning Defensive Player of the Year. He had 51 tackles, a league-leading 18.5 sacks and 48 quarterback hits last season.

The Niners expect to have Bosa available for their Week 1 game on Sunday in Pittsburgh.

More must-reads:

TODAY'S BEST
Watch: UFL championship marred by late on-field altercation between Stallions, Brahmas
Watch: Bryson DeChambeau pays tribute to the late Payne Stewart after winning U.S. Open
Bryson DeChambeau prevails in dramatic final round battle to win U.S. Open
Dodgers star will miss 'some time' with broken bone in left wrist
Former MLB journeyman dies at 61 years old
Rory McIlroy chokes away U.S. Open with pair of brutal missed putts
Pivotal Celtics center deemed questionable ahead of Game 5
Draymond Green weighs in on Klay Thompson's latest move
Tom Brady makes his broadcasting debut during UFL championship
Former top-five pick could follow the Dante Exum blueprint for NBA return
Yankees shelve top prospect once more due to injury concern
Sky forward Angel Reese rips officials following loss to Fever
Watch: Reds' Elly De La Cruz scores from second base on pickoff attempt
Dodgers' Dave Roberts confirms Yoshinobu Yamamoto is going on 15-day IL
Watch: Fighter jet flyover briefly interrupts Orioles at-bat
Rangers designate right-hander for assignment
Watch: Denmark's Christian Eriksen nets goal at Euro 2024 three years after suffering cardiac arrest
Giants place left-hander on 15-day IL with ankle sprain
Oilers crush Panthers in Game 4, stay alive in Stanley Cup Final
Dodgers ace leaves game against Royals due to triceps tightness