The Buffalo Sabres were clinging to a 3-2 lead with just over five minutes to play against the New York Rangers when Peyton Krebs took a careless high-sticking penalty. Krebs, who played most of this game with a bloody face after taking an early hit from Braden Schneider, caught Vincent Trocheck with his stick in the offensive zone. Trocheck was bleeding, so the Sabres had a four-minute Rangers power play to secure a win.

But just 15 seconds into the penalty kill, Mattias Samuelsson took the pressure off with an odd-angle short-handed goal that put the Sabres up 4-2. Ryan McLeod picked off a pass in the defensive zone and then slid a pass between two Rangers to get Samuelsson started on the rush. It looked like he might carry the puck into the corner, but instead, he ripped a shot right by the ear of Rangers goalie Jonathan Quick.

“That’s a goal scorer’s shot right there,” Sabres coach Lindy Ruff said after the game.

And this season, Samuelsson has been a goal scorer and offensive playmaker. He also had an impressive assist on the Sabres’ first goal of the game. After scoring seven goals in his first 212 NHL games, Samuelsson now has seven goals in 40 games for the Sabres this season. After two injury-riddled seasons, Samuelsson has become a shutdown defenseman for Buffalo and is adding some offensive pop with 22 points so far this year. It’s fitting that Samuelsson forced the bad pass that led to the turnover that eventually became his goal.

The Sabres, who came into the game ranked second in the NHL in penalty kill percentage, held the Rangers scoreless on their three power plays. After Samuelsson’s short-handed goal, the Sabres held New York off the board for the remainder of that power play and then got an empty net goal when McLeod’s shot from the defensive zone went wide of the net, but he beat every Ranger to the puck to finish the empty netter.

This was a game that could have gotten away from the Sabres. They took a 3-1 lead into the third period, but the Rangers controlled the game for most of the final period. The Rangers had a 14-3 advantage in shots and a 14-5 advantage in scoring chances in the third period.

“They had a good push,” Samuelsson told reporters after the game. “It’s going to happen. They’re down a couple. They have to. But I think we did a good job of sticking together as units of five out there in the D-zone and weathering the storm.”

It wasn’t the Sabres’ cleanest win of the season, but Ruff again pointed to the desperation the team showed. The Sabres had 20 blocked shots and did enough to clear rebounds away from Colten Ellis, who was making his first start since Dec. 9. The Sabres are now 17-1 this season when leading after two periods.

“We’ve been in situations like this a lot in this recent stretch,” Samuelsson said. “We’re definitely getting more comfortable holding onto leads in the third. It’s obviously really hard to win in this league. As a group that hasn’t done maybe as much as we should have in the past, I think we’ve finally kind of turned the corner in learning how to close out games.”

Buffalo has now won 12 of its last 13 games and eight of its last nine on the road. The Sabres will wake up on Friday morning in the second wild-card spot. They continue to look like a team that is capable of contending for a playoff spot in a congested Eastern Conference.

Here’s what else we saw in the Sabres’ win.

1. Ellis looked locked in for most of his first game since Dec. 9. Vincent Trocheck beat Ellis five-hole early in the third period for a goal that Ellis should have stopped, but otherwise, he made the big saves when the Sabres needed them. He plays an unconventional style based heavily on his reads and willingness to compete for every save. It’s a strong sign that he was able to jump right back into that type of game on the road. He stopped all nine of the high-danger shots he faced.

2. Bowen Byram continues to be a major source of offense for the Sabres. On Buffalo’s second goal, he took the puck the length of the ice and gained the offensive zone with possession. He then found Alex Tuch, who had enough time and space to beat Quick with a perfect shot from the slot. Byram has become a major play driver for the Sabres from the blue line and he also finished the game plus three.

3. The Sabres managed to get a power-play goal, and it was ugly. Rasmus Dahlin took a shot from the point. Quick stopped it, but the rebound hit Jason Zucker in the back and went into the net. Zucker leads the team in power-play goals, and that one was a big one to put the Sabres up two goals. Zucker led the Sabres with five individual scoring chances in this game. He’s a difference maker on the power play but also made a big impact at five-on-five in this one.

4. Josh Doan has scored in four straight games after getting the Sabres on the board first in this game. He has 14 goals and 15 assists in 42 games and that first goal was a crucial one. The Sabres are now 16-2-1 when scoring first this season. That’s been a key ingredient during this recent stretch of winning for the Sabres.

5. Earlier this week, Ruff said he’d stay patient with Jack Quinn because the winger was still getting scoring chances. He still only has one goal in his last 19 games, but Quinn finished this game with four scoring chances and three shots on net. Finishing has been his biggest problem, but the chances were there again on Thursday night.

6. Could line changes be coming for the Sabres? The fourth line had a rare off-night in this game, getting heavily out-chanced. Noah Ostlund mixed in on the top line for a shift, but that was short-lived. Swapping Ostlund and Krebs would make sense. Ruff also has Josh Dunne and Tyson Kozak waiting to get back into the lineup if he wants to spark the fourth line another way. But some tweaks would be justified after this game.