Matt Grzelcyk is staying in his hometown.

The Boston Bruins signed the 26-year-old defenseman to a four-year contract Saturday with an annual cap hit of $3,687,500.

Grzelcyk, who played the 2018-19 and 2019-20 seasons on a two-year extension worth $2.8 million, would have headed to arbitration on Oct. 20 as a restricted free agent.

Should the Bruins gamble on veteran winger Mike Hoffman?

Instead, the Bruins locked up the Charlestown, Mass., native through 2024, ensuring a core member of their blue line will stay put after letting Torey Krug walk in free agency.

Grzelcyk is coming off his best season as a Bruin in which he tallied 21 points (four goals, 17 assists) and was a plus-15 in 68 games played. With Krug off to the St. Louis Blues, Grzelcyk potentially could join Charlie McAvoy as Boston's top defensive pairing.

The Bruins also re-signed fellow defenseman Kevan Miller but have a major decision looming with captain Zdeno Chara, who reportedly is mulling a free-agent departure after 14 seasons in Boston.