The 26-year-old forward could have become a restricted free agent on Friday, Oct. 9. He was traded to the Canadiens by the Columbus Blue Jackets for forward Max Domi and a third-round pick (No. 78) in the 2020 NHL Draft on Wednesday.
"I'm absolutely thrilled to be in Montreal for the next seven years. I couldn't be happier," Anderson said Friday. "In my situation, it was a no-brainer to sign an extension like that with the Canadiens because I think they're on the right path and they have so many key pieces and having success. I want to be a part of that, I want to be a part of the winning culture and I'm very excited for the new opportunity."
Anderson scored four points (one goal, three assists) and was limited to 26 games with the Blue Jackets this season because of a shoulder injury and did not play in the postseason.
Selected by Columbus in the fourth round (No. 95) of the 2012 NHL Draft, Anderson has scored 115 points (65 goals, 50 assists) in 267 regular-season games and eight points (three goals, five assists) in 21 Stanley Cup Playoff games.
With the pick acquired in the trade, Columbus on Wednesday selected defenseman Samuel Knazko from TPS in Finland's junior league.
"It's been a wild 48 hours with all that's gone on," Anderson said. "Obviously I didn't see it coming with the trade, but when a GM (Marc Bergevin) has been after you, it's always a good sign that he wants you and is committed to having you long term. I couldn't be happier to be in Montreal for the next seven years with the group of guys that I've heard so many good things [about]. I'm just looking forward to getting started and meeting everybody once I get the chance to get down there."
NHL.com columnist Dave Stubbs contributed to this report