Patrice Bergeron recorded his eighth career hat trick and his 400th NHL goal, and David Pastrnak ended Boston's 0-for-39 power-play slump with his 40th goal of the season to lead the Bruins past the Buffalo Sabres 5-0 on Thursday night.

It was already 4-0 when Bergeron gathered in a pass from Charlie McAvoy in the center and wristed it into the net with 2:13 remaining for his third of the game. Hats came flying over the glass, and the Bruins hugged their captain, jumping up and down on their skates.

Linus Ullmark made 37 saves against his former team for his first shutout of the season as he tries to win the job as No. 1 goaltender for the playoffs.

In the Bruins' regular-season home finale, they scored their first power play goal since April 2. They failed to convert on their first three Thursday, making it 39 in a row, then scored on two straight, with Taylor Hall making it 4-0 after the delay-of-game penalty assessed on the Sabres for unsuccessfully challenging Pastrnak’s goal.

Dustin Tokarski stopped 27 shots for the Sabres, who will miss the playoffs for the 11th straight season.

After a scoreless first period, the Bruins broke through six minutes into the second following a flurry in front of the net that ended with the puck landing in front of Bergeron in the slot. With Tokarski on his backside and out of position, the Bruins captain easily poked the puck into the net.

Bergeron made it 2-0 six minutes later after Jake DeBrusk dug out the puck behind the net and slid it into the slot. The Sabres challenged, saying that Boston had gone offside long before the goal; the play was upheld.

On the ensuing power play, though, the Bruins again failed to score, dropping them to 0 for 39 since April 2.

Pastrnak ended the slump two minutes into the third period when he cleaned up the rebound of Hall’s shot. Hall made it 4-0 two minutes later when Tokarski left another rebound in front.

7TH MAN

Goalie Jeremy Swayman won the Bruins 7th Player Award, which was presented before the game.

Swayman, 23, has a 20-11-3 record while posting a 2.34 goals against average this season while competing for the No. 1 job with Ullmark. He leads all rookies GAA, save percentage (.915), wins and shutouts (3).

Ullmark, who went 25-10-2 with a 2.51 GAA, appears to have earned the start — at least in the playoff opener. It would be his postseason debut; Swayman appeared in one game in relief of Tuukka Rask last year.

Coach Bruce Cassidy said earlier Thursday that he wasn’t against using both.

“It’s going to be a decision in the moment, I guess, is the easiest way to say it,” he said. “It could go one way or the other, to be perfectly honest.”

FOND FAREWELLS

The Bruins said goodbye to head athletic trainer Don DelNegro, who is retiring after 29 years with the team. There was a compilation of good luck videos shown on the scoreboard, and another video showed the players presenting him with a golf cart as a retirement gift.

After the game, the team posed for a picture with DelNegro at center ice and then he walked through the players to the bench.

UP NEXT

Sabres: Host the Blackhawks on Friday night in their 2021-22 finale.

Bruins: Finish the regular season in Toronto on Friday night.