BOSTON – Goalies Tim Thomas and Carey Price admitted their hearts weren’t in it when they squared off to fight Wednesday night.

And for most of the game, they played the same way.

Milan Lucic scored twice in a wild second period, and Nathan Horton had a goal and four assists as the Boston Bruins outslugged and outlasted the Montreal Canadiens to win, 8-6.

The teams combined for 182 penalty minutes, including seven apiece for Thomas and Price during a second-period fight that left the penalty boxes overflowing and the ice littered with equipment.

“I think we were just play-fighting more than anything,” Price said. “Neither of us really wanted to get hurt, but we’re out there doing whatever we had to do, I guess.”

Michael Ryder had two goals of the career-high eight Price allowed. David Krejci had three assists, and Brad Marchand, Dennis Seidenberg and Adam McQuaid also scored for Boston, which beat its Original Six rival for the first time this season and extended its lead in the Northeast Division to four points.

Boston had 24 penalties and Montreal was called for 21.

“Today was a big game. A lot of points were on the line. Important points,” said Canadiens forward Brian Gionta, who scored his 200th NHL goal. “It’s just an emotional game and that’s what you saw out there.”

Max Pacioretty scored two of Montreal’s four power-play goals as the Canadiens lost in regulation for just the third time in 10 games. P.K. Subban, Yannick Weber and David Desharnais added goals for Montreal; it was a season high in goals allowed for Thomas, who leads the NHL in save percentage and goals-against average.

Ryder had another goal waved off because Marchand crashed into the crease; replays showed Weber pushed him there.

That wasn’t the only contact the goalies saw. During a second-period brawl that left five Bruins and four Canadiens in the penalty box, Thomas sprinted to challenge Price.

They spent more time shedding their gloves and masks than actually punching.

“He fought with ‘fighter’s manners,’ as far as not hitting you when you’re down,” Thomas said. “We were just in the All-Star game together. We’re on friendly terms. It was business.”

A more conventional fight broke out with 41 seconds to play, with eight players squaring off, four receiving game misconducts. At the end the Bruins had five skaters left on the bench and Montreal six.

With the score 2-2, things got weird.

In quick succession the Bruins went ahead, Montreal tied it, Boston took the lead again, then made it 5-3 on Lucic’s first goal with 7:29 left in the second. Five seconds after the faceoff, players began squaring off in the corner at the Canadiens’ end and, after Price skated over, Thomas sprinted at his Montreal counterpart.

Just a punch or two later, Thomas was on the ice. And 12 seconds into the resulting Montreal power play, Desharnais cut the deficit to 5-4. But Lucic made it a 6-4 game two minutes later.