Zach Sanford

This was the last goal of the 2018-19 NHL season. The Blues’ Zach Sanford, a former Pinkerton Academy star, left, celebrates with teammate David Perron after scoring in the third period of Game 7 of the Stanley Cup Final against the Boston Bruins. Sanford re-signed with St. Louis on Monday.

Former Pinkerton star agrees to two-year deal with Cup champs.

New Hampshire’s Zach Sanford and the Stanley Cup champion St. Louis Blues agreed to terms on a two-year, $3 million contract on Monday.

The one-way contract has an average value of $1.5 million and allows Sanford, 24, to avoid a salary arbitration hearing, which he filed for last Friday.

The former Pinkerton Academy of Derry standout made $875,000 while on a two-way contract during the best campaign of his career last season.

Sanford was a regular in the Blues’ lineup for most of the second half of last season, recording eight goals and 12 assists in 60 regular-season games.

The Boston College product tallied four points (one goal, three assists) in eight Stanley Cup playoff games. Sanford’s one postseason goal — the first of his career — came in St. Louis’ 4-1 win over the Boston Bruins in Game 7 of the Stanley Cup Final.

It was the final goal of the game — and NHL season.

The Washington Capitals selected Sanford 61st overall in the 2013 NHL Draft and traded him to St. Louis in 2017.

Sanford has registered 28 career points (12 goals, 16 assists) in 99 NHL games over his time with the Blues and Capitals.

He has also registered 29 points (19 goals, 10 assists) over 52 career AHL games.