Rookie goalie Carter Hart helped the Flyers' end their post-holiday misery Thursday night at the Wells Fargo Center.

For the first time since before Christmas, they celebrated a victory.

Hart, 20, stopped 37 of 38 shots as the Flyers defeated Dallas, 2-1, and snapped an eight-game losing streak.

The Flyers, who were 0-6-2 during their skid, got goals from Travis Konecny and James van Riemsdyk as they won for the first time since a 3-2 shootout victory over the host New York Rangers on Dec. 23.

With 2 minutes, 51 seconds left in regulation, Jamie Benn cut it to 2-1 when he got space in the slot and fired a shot off Hart and into the net.

Jake Voracek made it 3-1 with 1:03 remaining, but the goal was erased because of goaltender interference by Voracek.

Hart withstood a late barrage and the Flyers survived. Finally.

“It got a little hairy at the end with all the shots they were getting, but Hartsy did a great job and stood tall,” van Riemsdyk said as “Sweet Caroline” played in the locker room.

Benn’s goal ended Hart’s shutout bid. He would have been the youngest goalie in Flyers history to collect a shutout. (Dominic Roussel was 22 years and five days when he did it in 1992.)

“It just feels good to be back in the win column,” said Hart, who had lost five straight despite playing well in most of those games. He now has a 2.46 goals-against average and .920 save percentage in eight starts. “The last few games, the boys have battled hard and some bounces haven’t gone our way.”

After a sleepy first period that included more combined blocked shots (16) than shots (13) by the teams, the Flyers struck first as Konecny redirected a slick backhand pass by van Riemsdyk past backup goalie Anton Khudobin and into the net’s right corner.

“I don’t know how Reemer saw me,” Konecny said after his 11th goal of the season put the Flyers ahead, 1-0, with 18:37 left in the second period.

Thirty-one seconds later, Hart stopped Julius Honka’s wraparound attempt. Hart stopped all 20 shots he faced in the first two periods, and he robbed John Klingberg from the doorstep with 6:18 to go in the second.

Besides his quick reflexes, Hart has impressed van Riemsdyk with his mental makeup. He said the young goalie had ice water in his veins and a quiet confidence in himself.

“You can tell he’s got a really good mind-set,” van Riemsdyk said before the game. “Just watching him off the ice, he wants to get better and know the whys of different things he’s doing. ... He’s like a sponge and he’s taking advantage of the different resources to continue growing his game. And when you have that mind-set, the sky is the limit, especially when you have the skill-set he has.”

Van Riemsdyk, who played on the fourth line Tuesday and was moved back to the top line on Thursday, made it 2-0 with 11:09 left in the second as he deflected Sean Couturier’s pass off the skate of Dallas defenseman Esa Lindell and into the net.

“I think in the first period we were doing a little too much of the cute plays, the back-and-forth tic-tac-toe stuff," Konecny said, “and in the second we were just trying to get pucks on net.”

The Flyers' 2-0 second period advantage was a reversal of a pattern that weighed down the team during the eight-game losing streak. They were outscored in the middle period, 15-1, in those games.

In the third period Thursday, Couturier and Claude Giroux had a pair of two-on-one shorthanded rushes. Couturier was denied both times. Later in the period, Konecny was stopped by Khudobin as the Flyers had a two-on-zero break.

The Stars had an 18-10 shots advantage in the third period, but Hart had all the answers.

“We held our ground and kept them to the outside,” said defesneman Radko Gudas, who had six hits and seven shots (four on goal) in the win.

During their losing streak, the Flyers were outscored 31-15 despite being outshot by only 259-258 and having a 434-395 advantage in shot attempts.

Defensive breakdowns, which seemed to always be converted into goals, plagued the Flyers during the skid. But it was the Flyers, not Dallas, who had many more odd-man rushes Thursday.