CALGARY - A couple of unlucky breaks prevented the Calgary Flames from potentially celebrating a victory Wednesday night.

Justin Abdelkader and Henrik Zetterberg each had a goal and an assist as the Detroit Red Wings built up a two-goal lead and survived a some close calls in the third period — including a shot that hit the post and a waved off goal — to beat Calgary 3-2.

"It's tough in here right now," said Flames captain Mark Giordano. "I thought a couple breaks go the other way and we at least get it to overtime. We have to take some positives out of that."

Riley Sheahan also scored for Detroit (22-10-9), which has won five of its last seven games. The Red Wings have won two of their first three games on a six-game road trip.

Mason Raymond and Mikael Backlund scored for Calgary (21-17-3). The Flames are 3-2-0 with one game to go in a six-game homestand.

"This game is so fast, sometimes the game goes on your side, some other times, it's just not there," said Flames coach Bob Hartley. "The bottom line is we worked hard but we gave the first two goals. We missed assignments on those first two goals. We made it tough."

Detroit took a 2-1 lead at 17:28 of the second period.

Zetterberg started the sequence by beating Sean Monahan on a face-off deep in the Flames end, and finished it by firing an Abdelkader pass behind Jonas Hiller for his 10th of the season.

For Zetterberg, playing in his 800th career game, that's 10 goals on the season — five of which have come in the last nine games.

"It's always nice to get goals nowadays. Obviously this game is a little bit more special," Zetterberg said. "We played the way we wanted to and I think that's important. It was nice to see we bounced back after the Vancouver loss to win the last two games."

The same trio struck again 2:03 into the third period to make it 3-1. Moving the puck around smartly on the power play, Gustav Nyquist set up Abdelkader at the corner of the goal crease.

Staring at a wide open net, Abdelkader's initial shot rattled off the far post but it came right back to him and he buried his career-high 11th goal for the eventual winner.

"I probably had more time to sit it down and take it easy but I don't know why, I just decided to one-time it and luckily it came right back to me and I had a chance to put it in. So I can laugh about that one," said Abdelkader.

Calgary cut the deficit to 3-2 on Backlund's short-handed goal at 5:13 of the third period. But despite coming on strong, Calgary could not get the game back to even.

Nine seconds into a Detroit penalty, Jonathan Ericsson fired the puck over the glass. While replays showed it went straight out of play, the officials — without that benefit — huddled to discuss the play and did not assess a penalty.

Flames defenceman T.J. Brodie hit the goal post shortly after.

A Paul Byron goal with 1:20 left in the game was waved off because just seconds before, Wings goaltender Petr Mrazek had his helmet knocked off when Ericsson pushed Curtis Glencross into him.

"I don't know if he would have got over and made the save or had a chance on it but that's obviously a tough break to happen at that time in the game," said Giordano. "Unfortunately, it probably cost us a goal tonight."

Calgary did not take advantage of four power plays throughout the game. Ranked 26th entering the game, the Flames' power play is 3 for 38 in its last 11 contests. Detroit entered the night ranked fourth in penalty killing.

"Our penalty kill was great tonight. We had some big kills," said Abdelkader, who was the player in the box for two of Calgary's four chances. "Whether it's penalty kill or power play, both of those can create equal momentum for you and that was no different tonight."

Hiller entered the game halfway through the second period in relief of Karri Ramo. Making his first start since Dec. 16, a game in which he was pulled after four goals on 13 shots, Ramo again only made it halfway through the game.

This time, Ramo had 12 saves and was locked in a 1-1 tie when he was injured in a collision with Raphael Diaz. Racing out of his crease to dive and knock the puck away from Drew Miller, Ramo was kneed in the head by Diaz, who was chasing after Miller. Ramo had to be helped off the ice.

"We should have more news tomorrow," said Hartley. "It's sad for Karri because he worked so hard. He got sick before Christmas, lost a start at that time and he battled back. He seemed ready for tonight's game."

Back in the line-up after being scratched the past two games, Raymond gave the Flames a 1-0 lead 2:27 into the game. His shot from a sharp angle was stopped but the rebound came back to him and he circled behind the net and tucked in his first goal since Oct. 19.

Raymond (shoulder) had missed 18 games before returning in early December. However, he found himself in the press box after being held without a point in 10 games.

The Red Wings tied it at 7:58 when Sheahan burned down the wing, made a nice move to beat Deryk Engelland to the outside, then put a perfect shot over Ramo's shoulder.