‚ÄčOn a homestand loaded with Stanley Cup contenders, the Boston Bruins held tight to their tenuous playoff position by edging the Calgary Flames.

Patrice Bergeron scored a tie-breaking goal with 3:24 left in the third period and the Bruins hung on to beat the Flames 2-1 on Tuesday night.

"We had to make a play at some point. It was late in the game and it was an important goal obviously," Bergeron said. "We know how hard the schedule is coming up and how important and how tight the standings are."

The Bruins are in the midst of a four-game homestand, their longest of the season and quite possibly the most difficult stretch they'll have.

It started with a 4-1 loss to Tampa Bay on Sunday and resumes Thursday against the Stanley Cup champion Chicago Blackhawks, followed by the Washington Capitals, who have the best record in the league.

The Bruins couldn't afford to fall to the road-weary Flames, who were coming off a loss at Philadelphia the night before and have lost six in a row.

"I don't think we were as sharp as we needed to be, but it was big for us that we came through on the power play at the end," said Landon Ferraro, who scored Boston's other goal. "It was big to get those two points and not have to try and work for the other one in overtime."

There were few chances at either end of the ice. The Flames were the only team to reach double figures in shots during a period, getting 11 on net in the third. The only one to go in was by Jakub Nakladal, whose first career goal tied it at 1-all 5:35 into the period.

Costly penalty

The Flames picked up the pressure from there, but a costly penalty for too many men on the ice with 4:07 left in the third gave Boston its fifth power-play opportunity and the Bruins took advantage.

"We had too many men. It was the right call," Calgary coach Bob Hartley said.

Joni Ortio had 23 saves for Calgary, but had little chance on either of Boston's goals, one-timers by Ferraro and Bergeron.

"Joni was very solid," Hartley said. "He got beat by two great shots, so nothing to fault. You know what? I can't fault the effort all night. A bad break at the end and that cost us the game."

Ferraro gave Boston the lead on a one-timer from the slot off passes from Brett Connolly and Torey Krug 7:05 into the game.

Rask had a shutout going until Nakladal scored 5:35 into the third on a slap shot from the top of the left circle. Jyrki Jokipakka and Michael Frolik assisted.

The Flames, who lost in Philadelphia 5-3 on Monday night, kept it close early with defense. Calgary held Boston to five shots in the first and nine in the second as the Flames regained their strength.

Nakladal's goal gave Calgary a lift and the Flames nearly took a lead a few minutes later, but Rask stopped Michael Ferland three times as he attempted to swipe in a rebound from in front of the crease.

"A lot of times when we create scoring chances then we give up a lot," Rask said. "Today we didn't create a lot, we didn't give up a lot and we ended up winning, which is a great sign."