BOSTON (AP) The Boston Bruins made up for a slow start with an impressive finish.

Patrice Bergeron played a key role.

Bergeron score two of Boston's three goals in the third period, and the Bruins pulled away from the Calgary Flames for a 5-2 win on Tuesday night.

Boston held Calgary to 17 shots in the last 40 minutes and scored four straight goals after falling behind 2-1.

"We played much more to our style of play, how we want to wear teams down and eventually get our looks," coach Bruce Cassidy said.

"That's essentially what we asked our group to be after the first period. Let's just play hard, get back to competing hard and winning pucks, getting there first. If you're not getting there first, arrive ornery and I thought we did a good job."

Riley Nash also scored twice and David Backes had two assists for the Bruins, who won for the sixth time in seven games. Zdeno Chara had an empty-net goal and Tuukka Rask stopped 27 shots.

"I thought the last 40 minutes were the way we want to play," Bergeron said. "That's heavy team that's got a lot of skills. It's going to happen. You're not going to dominate and be at your best all the time."

Calgary had won four of five. Sam Bennett and Johnny Gaudreau scored for the Flames, and David Rittich had 35 saves.

Down 4-2, the Flames gambled by pulling Rittich for an extra skater and Chara made them play with an end-to-end shot with 3:46 left to play.

After coming up empty on five power-play opportunities, the Flames felt they cost themselves a chance at a point or two in the fifth of six straight on the road.

"We've just got to better obviously on special teams," said Flames captain Mark Giordano, who assisted on Gaudreau's goal. "We had our looks on the power play. We had some good kills early but at the end of the day not good enough."

The Flames wrap up the long trip Thursday at Nashville.

Boston jumped in front on Nash's ninth goal just 28 seconds into the game, but Bennett got his eighth of the season at 2:03 and Gaudreau stuffed in a rebound at 9:12 to put Calgary up 2-1.

Nash tied it with 3:40 left in the second, and Boston regained the lead 1:15 into the third period when Bergeron scored on the power play. Bergeron took a long pass through center ice from Torey Krug and beat Rittich with a wrist shot to the stick side.

It was the 26th goal of the season for Bergeron, who added No. 27 at 9:19 when he tipped in a shot from Brad Marchand after blocking a shot in Boston's own zone and starting the Bruins on an odd-man rush the other way.

"You always try to take care of the D-zone first and then you can think offense," Bergeron said. "Obviously after that we were able to sustain some pressure and eventually get the goal."

NOTES: Nash's two goals gave him 10 for the season, tying the career high he set with Carolina in 2013-2014. ... The Bruins honored the 40th anniversary of the 1977-78 lineup that featured 11 players who scored 20 or more goals. Ten members of the team were introduced in a pregame ceremony along with former coach Don Cherry. ... Rittich was making just his 11st start of the season. G Mike Smith is day to day with a lower-body injury that forced him to leave Sunday's win against the Islanders in New York with 2 seconds remaining. ... The Flames were without F Troy Brouwer, placed on injured reserve Monday with an upper-body injury.