The Boston Bruins and forward Danton Heinen have avoided arbitration by agreeing to a two-year, $5.6 million contract.

The deal carries an average annual value of $2.8 million. Heinen was set to have a hearing on Aug. 3 had the two sides not reached a deal.

The 23-year-old scored 11 goals and posted 34 points in 77 games this past season. Heinen scored two goals and posted eight points in 24 playoff games as the Bruins lost to the St. Louis Blues in the Stanley Cup Final.

Heinen was drafted in the fourth round (116th overall) by Boston in the 2014 NHL Draft.

He is coming off his three-year, entry-level contract.

The Canadian winger has 81 points in 162 NHL games.