Travis Sanheim scored with two seconds remaining on a power play in overtime to lift the visiting Philadelphia Flyers past the Boston Bruins 3-2 on Thursday.

Claude Giroux and Oskar Lindblom each scored for the Flyers, who won their sixth in a row. Jakub Voracek added two assists, and Sanheim also tallied a helper. Flyers goaltender Carter Hart made 23 saves.

David Pastrnak scored both goals for the Bruins. Bruins goaltender Tuukka Rask stopped 38 shots.

The Bruins took an early 1-0 lead when Pastrnak scored for the 29th time this season at 3:05 of the first period on the power play.

Hart made a number of solid saves to keep the Flyers close, and it paid off when Giroux tied the game at 1 at 19:16. Giroux skated free and sent a wrist shot past Rask for his 15th goal of the season.

Pastrnak struck again at 5:11 of the second with a blistering slap shot for a 2-1 Boston advantage. It was his 30th goal this season.

About four minutes later, Travis Konecny nearly tied the game, but Rask made a sprawling save directly in front of the net.

Pastrnak almost registered a hat trick with 4:31 left in the second, but Hart got just enough of the puck to swat it off the side of the net.

The Flyers led 25-17 in shots on goal but trailed 2-1 at the end of the second.

Philadelphia’s Scott Laughton stole the puck, raced in and was taken down by John Moore to draw a penalty shot with 13:18 remaining in the third. But Laughton’s ensuing attempt was denied by Rask’s blocker.

The Flyers kept the pressure on, and Lindblom connected on the power play at 10:36 to tie the game at 2. It was Lindblom’s first career power-play goal.

Sanheim’s goal came 2:56 into overtime while playing in his 100th career NHL game. Konecny was pulled down by Brad Marchand to force the power play.