Thornton, who leads the NHL this season with 19 major penalties for fighting, has a career-high 143 penalty minutes with four goals and eight assists this season and 29 goals, 43 assists and 759 penalty minutes in his career.
"It's a little weight off the shoulders," he said after Boston's 8-0 win over the Toronto Maple Leafs on Monday night. "Myself and the guys that haven't had (extensions) done yet have done a pretty good job focusing throughout the season. It wasn't a distraction."
General manager Peter Chiarelli said Thornton's contract is worth $1.1 million each year.
"You see some of the skill that he has when he scores, when he makes some plays," Chiarelli said, "but, most importantly, you see the enthusiasm and the vigor that he brings to the rink every day."
And that's important to coach Claude Julien.
"Everybody knows that Shawn will come to play every night, play hard, and go to his team's defense," he said. "I'm glad to see that he's here for a couple more years, at least. The one thing I like about guys that do that job is that they can also play."
Thornton, 34, joined the Bruins as a free agent for the 2007-08 season after being part of the Anaheim Ducks team that won the Stanley Cup the previous season. He won his second championship last season with the Bruins after compiling career highs of 10 goals, 10 assists and 20 points.
He was originally drafted by Toronto in the seventh round in 1997.
"It's definitely a little easier when you know you're going to be somewhere for a few years," Thornton said.