PHILADELPHIA — No longer struggling, the suddenly confident Philadelphia Flyers are now able to overcome their own blunders.

Valtteri Filppula scored the game-winner with 2 1/2 minutes left in the second period and Travis Sanheim netted his first career goal to help the Flyers win their fifth straight game, 2-1 over the Buffalo Sabres on Thursday night.

Brian Elliott rebounded from a costly mistake early in the game to make 19 saves for the Flyers, whose winning streak has come on the heels of a 10-game losing streak. The winning stretch began with a three-game Canadian trip that started with coach Dave Hakstol changing the team's formation to a more defensive-minded 1-2-2 alignment. Philadelphia (13-11-7) has outscored opponents 19-8 since.

Buffalo opened the scoring 1 1/2 minutes into the game thanks to a miscue by Elliott. The Flyers goalie attempted to clear the puck from behind the net, but he passed right to Buffalo's Zemgus Girgensons. The Buffalo centre then passed in front to Ryan O'Reilly, who shot into an empty net for his eighth goal of the season.

"A little miscommunication and a bad play on my part," Elliott said.

But the Flyers didn't get rattled — something that maybe wouldn't have happened two weeks ago.

"You can take a punch better when you have a swagger to your game," Hakstol said.

Said Elliott, "It could go sideways in a hurry, but we sorted it out."

The Sabres (8-18-6) are in the cellar of the Eastern Conference. Buffalo was looking for back-to-back wins for the first time since Oct. 21-24. The Sabres' point streak was snapped at five games.

"We built something in the last four games and I thought we could've taken another step tonight, but we didn't execute," Sabres coach Phil Housley said.

Filppula put the Flyers ahead 2-1 after Jakub Voracek set up the play with his eighth assist in the last five games, passing to a cutting Filppula who shot high over Robin Lehner's right shoulder.

"I don't think it was our best game, but you need to win these kinds of games," Filppula said. "It's a good sign."

The Flyers tied the game at 1 just over 4 minutes into the first period on Sanheim's first career goal as the rookie defenceman's wrist shot from long range got past Lehner.

"It was a long time coming, but it was exciting to get my first one," he said.

Thirty seconds before Sanheim's tally, Elliott made a mistake similar to the one that led to Buffalo's goal. Sam Reinhart intercepted his pass from behind the net, but Reinhart's shot with Elliott out of the crease was denied by rookie centre Nolan Patrick.

"Kind of desperation," Patrick said of the save.

The Sabres entered with the fewest goals in the league (67) and the first-period tally was just their 15th of the season in the opening 20 minutes.

Notes: Sabres D Nathan Beaulieu (illness) missed his fifth straight game and C Jacob Josefson (ankle) sat out his eighth in a row. . It was the first of three meetings between the clubs. Buffalo hosts the Flyers Dec. 22 before coming back to Philadelphia on Jan. 7. . Philadelphia has won all five games during the streak in regulation, something they hadn't done since Oct. 26-Nov. 11, 2010. . Flyers LW Michael Raffl recorded an assist, extending his point streak to five contests, while playing in his 300th career game.

UP NEXT

Sabres: Host Carolina on Friday night.

Flyers: Host Dallas on Saturday night.