BUFFALO - For the second time in their last three games, the Flyers overcame a three-goal deficit and produced a stirring victory.

Claude Giroux scored on a breakaway with 2 minutes, 23 seconds remaining in overtime Wednesday night, lifting the Flyers to a 5-4 win over Buffalo in front of a stunned crowd at the First Niagara Center.

The goal gave Giroux four points on the night, and put him atop the NHL with 36 points.

In the overtime, Giroux made a series of moves and beat goalie Ryan Miller to give the Flyers their third straight win.

"I'm trying to freeze him and trying to find a hole," said Giroux , who has scored the game-winner in the Flyers' last three victories. "I saw him move his stick there, so I just tried to put it right in his five hole."

The Flyers completely shut down Buffalo in the third period until Drew Stafford was left alone in front and scored the tying goal with 1 minute, 35 seconds left in regulation. Marc-Andre Gragnani, from behind the net, fed Stafford, who knotted the game at 4-4.

With the win, the Flyers moved to within one point of first-place Pittsburgh in the Atlantic Division.

Trailing 3-0, the Flyers got life when Max Talbot scored with a little over a second left in the opening period.

"That," winger Scott Hartnell said, "was huge."

So was Hartnell's tying goal with 5:15 left in the second period. About three minutes later, Jaromir Jagr gave the Flyers their first lead, at 4-3.

The Flyers also overcame a 3-0 deficit on Friday, scoring a 4-3 overtime win in Anaheim.

The Flyers have Miller's number. The (usually) standout goalie is 2-7-1 in his last 10 home starts against the Flyers.

As the first period ended, Zac Rinaldo fought Buffalo's Corey Tropp. Rinaldo was decisioned, but Hartnell said it gave the team a lift.

"Zac tosses the mitts, throwing some lefts and rights and that gave us a lot of energy," Hartnell said. "But coming into the locker room, the coach wasn't happy and we weren't happy."

The Flyers regrouped and scored on three of their nine second-period shots to take a 4-3 lead. They are now a league-best 10-3-1 on the road, while Buffalo fell to 5-9-1 at home.

"That's the kind of team we are; we don't quit. Guys have a lot of character," Giroux said. "We're having a lot of fun here, and that makes it a lot easier to play."

After winning in Anaheim and Phoenix over the weekend, Jagr expected a difficult game.

"From my experience, I knew it was going to be tough," he said. "Every time you play out West and then come back and play a game in a few days, it's the hardest. You could see the first 10 minutes, we didn't have our legs. But somehow, we slowly (got them). The key goal was obviously the last second of the first period. Two goals down, you can come back."

Danny Briere, perhaps bothered by the after-effects of a virus, played just 9:22.

Miller continued to struggle against the Flyers, allowing a 3-0 lead to disappear in a span of less than a period.

Talbot scored with 1.5 seconds left in the first period, and Matt Read, Hartnell and Jagr netted second-period goals as the Flyers took a stunning 4-3 lead.