BUFFALO, N.Y. — Drew Stafford broke out of his scoring slump with a highlight-reel goal at a critical moment.

Stafford’s third-period goal was his first in 18 games, and it propelled the Buffalo Sabres to a 4-2 victory over the Boston Bruins on Thursday night.

“You know, long time coming,” Stafford said. “I had to stick with it, and sooner or later one was going to have to go in. I’m getting my shots, getting my chances.

“To be able to do get one there to help contribute to a win makes it even better.”

Stafford raced down the right side of the Boston zone and went around the net to score just his third of the season.

“The shallower nets allow for those wrap-around goals to be a little more effective,” Stafford said. “Just trying to get it through. Sometimes it works. Sometimes it doesn’t. Fortunately tonight it went in.”

Ryan Miller made 34 saves, and Marcus Foligno and Brian Flynn both had a goal and an assist. Tyler Myers also scored for Buffalo, which has won consecutive games for the first time since Nov. 15.

Brad Marchand scored both Bruins goals, and Chad Johnson allowed four goals on 23 shots.

“We deserved a better fate, I think, than what happened,” Bruins Coach Claude Julien said. “I thought we controlled the game pretty good, but their goalie made some pretty big saves to keep them in the game.”

The Sabres continue to show much better form after winning just six of their first 30 games. Buffalo is 3-1-1 in its last five and has scored four goals in consecutive games.

“We’ve been coming together,” Foligno said. “Goals have been coming together. If we’re putting the work in, points will start happening. That’s what guys are believing in. That’s the system here, and everyone’s on board.”

The game’s start was lackluster, with one goal and just 13 shots combined in the first period.

Boston’s Milan Lucic tricked Mike Weber into dropping his gloves, and the Bruins earned a late first-period power play, but it was the Sabres who took advantage.

Flynn stripped the puck from Johnny Boychuk in the neutral zone and used his backhand to score on the ensuing breakaway. It was Buffalo’s first short-handed goal this season, and Flynn’s first goal since Oct. 26.

“One thing about Flynn is he has a real quiet demeanor about him,” Sabres coach Ted Nolan said. “Sometimes you don’t even know he’s at practice unless you just watch him. He’s so quiet, but he was sure loud tonight, the way he played.”

The Bruins tied it 1-1 with a short-handed goal of their own when Marchand beat Miller 1:50 into the second period.

Marchand added his second goal of the night less than two minutes later.

“It’s obviously nice to get one or two, but all that matters is we lost,” Marchand said.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.