BOSTON – Thomas Vanek stood in front of the Boston net, his back to the goal, as long as he could before a hit from Andrew Ference sent him flying.

Even as he fell, he got enough on the puck to set up Tyler Ennis for a goal.

“That pass to Ennis was really second to none,” Sabres Coach Lindy Ruff said Thursday night after Vanek had his second five-point game of the abbreviated season to lead Buffalo to a 7-4 victory over Boston. “It’s hard to say it isn’t his best stretch.”

Vanek had three goals and two assists, setting up the tiebreaking score with 13:06 left in the third period and picking up his eighth career hat trick with 91 seconds to play to help the Sabres end a four-game winless streak. It was Vanek’s second career five-point game.

“Pucks are going in right now for me,” he said. “There’s going to be stretches where nothing goes. So you like it right now, but you know it’s going to head the other way.”

Ryan Miller made 38 saves for Buffalo, and Tuukka Rask stopped 25 shots for the Bruins. Brad Marchand scored two goals and Rich Peverley and David Krejci had one apiece for the Bruins, which had points in its first six games.

“We had a great start,” forward Milan Lucic said. “You’re bound to lose at some point.”

Vanek opened the scoring 98 seconds into the game, then had another after Boston scored three times in under six minutes in the second. Ninety-three seconds after making it a 3-2 game, Vanek made a pass to Ennis as he went sprawling to the ice.

“That’s what I bring to the team,” Vanek said. “Be good in front and make plays for the team.”

The Bruins went up 4-3 in the third before Alexander Sulzer tied it on a wrister from the faceoff circle, and then Vanek helped give Buffalo the lead when he kept the puck in the zone, faked a shot and slid it over to Cody Hodgson for the game-winner.

And Vanek was trailing the play — but did not get an assist — when Jason Pominville skated in for the empty-netter with 14 seconds left to clinch it. Vanek, who entered the game tied for sixth in scoring in the league, now has 54 points in 46 career games against the Bruins.

Vanek gave the Sabres the lead after a scoreless first period, but Boston came back with three straight goals to open a 3-1 lead. The Sabres tied it again, thanks in part to a 5-on-3 power play when Lucic and Zdeno Chara were both sent off for penalties.

Midway through the two-man advantage, Vanek deflected a pass from Christian Ehrhoff into the net. He added an assist to make it 3-3.

Krejci gave Boston the lead early in the third, but Sulzer tied it 4-4 less than a minute later and Hodgson added the go-ahead goal with 13 minutes left.