This was almost inexplicable, and not the way the Rangers would have drawn it up.

Imagine, a 1-1 game going into the third period at home Thursday night against the Buffalo Sabres, the last-place team in the NHL, with playoff seeding on the line.

But Rick Nash scored with 1:42 left in regulation and the Rangers won, 2-1. They clinched second place and home-ice advantage in the first round when the Flyers lost to the Lightning, 4-2, in Tampa.

Henrik Lundqvist made 23 saves for the Rangers (45-31-5, 95 points), who will play either the Flyers or the Columbus Blue Jackets in the first round of the playoffs, which begin next week.

In the final regular-season game at Madison Square Garden, the Rangers had their first shot of the third period with 6:21 left and were 0-for-4 overall on the power play against a team that had lost four straight and a goaltender who was 1-4-1 this season.

The Sabres had three power plays in the third period, but the Rangers were rescued from an embarrassing performance, salvaging the win when Martin St. Louis fed Nash for a one-timer that beat Matt Hackett.

The Rangers had some luck when a Buffalo shot hit the post with eight seconds left to close out a bizarre game.

Coach Alain Vigneault said: "In a game like tonight, I'm not going to try to dig too deep into my brain to try and figure it out. We'll take the two points and move on."

The Sabres had their first power play with 9:47 left in regulation after a hook by Dominic Moore. It was the first power play against the Rangers since the 3-2 loss to the Senators on April 5.

The tying goal for the Rangers came after a tape-to-tape backhand pass from Mats Zuccarello to Benoit Pouliot, who roofed his 15th goal past Hackett with 31 seconds left in the second period.

It was the 18th shot of the period for the Rangers. The Sabres had only one -- and scored on it. Mike Weber's shot from the right point, which looked harmless, was deflected just inside the far post by Drew Stafford at 9:05.

Hackett stayed in the game after Brad Richards' power-play slapper caught him below the mask with 2:12 left in the second. He was down and the trainer came for a visit, but he stayed in the game.

Entering the game, the Sabres had lost four straight games, were dead last in the league at 21-49-9 and 51 points, and were 3-14-1 since the March 5 trade deadline.

But it was another rough start for a team with higher expectations. In an uninspired first period, the Rangers were outshot 12-9, with only six shots at even strength. Pouliot had the best chance, skating in alone on the right side at 7:30, but his wrister was blocked by Hackett.

The Rangers had no shots on Hackett for the first 6:38 and only one shot on a power play that began at 10:55 after Zemgus Girgensons went off for hooking. Lundqvist's toughest save came on a three-on-one when a sliding John Moore prevented a centering pass and Chris Stewart fired into Lundqvist, who was hugging the left post.

Christian Ehrhoff's slash in front when Hackett was covering the puck at 18:29 carried into the second. After scoring twice on the power play against Carolina, the Rangers overpassed rather than attacking Hackett, who was 1-4-1 entering the game.