NEW YORK (AP) — Despite ending the regular season with consecutive losses, the Detroit Red Wings found a way to extend their remarkable playoff streak.

Kevin Hayes scored with 5:38 remaining, Antti Raanta made 31 saves and the New York Rangers defeated the Red Wings 3-2 on Saturday.

Even with the loss, the Red Wings reached the playoffs for a 25th consecutive season when the Ottawa Senators beat the Boston Bruins 6-1. Detroit clinched third place in the Atlantic Division and will play the Tampa Bay Lightning in the first round.

"It’s great," first-year Red Wings coach Jeff Blashill said. "Our goal at the beginning of the season is to win the Stanley Cup, and to do that then, our immediate goal then was to find a way to earn a way into the Stanley Cup playoffs."

Hayes tipped Dylan McIlrath’s shot past Jimmy Howard for his 14th goal of the season to make it 2-1. Oscar Lindberg added an empty-net goal to make it 3-1.

Detroit’s Justin Abdelkader scored with 1:34 remaining to cut the deficit to 1, but New York was able to kill off two late penalties and hang on for the win.

Riley Sheahan scored in the second period for the Red Wings and Howard made 17 saves.

"It feels good," Red Wings forward Henrik Zetterberg said of making the postseason again. "We had good chances to really find the back of the net, but we just have to send a thanks to Ottawa. They showed up in Boston and played a good game."

Dan Boyle scored in the first period for the Rangers, who finished the regular season with 101 points and still don’t know who they will meet in the playoffs, which start Wednesday.

Raanta got the start in goal for the Rangers in place of Henrik Lundqvist.

"I’m feeling really good." Raanta said. "The defenseman have been helping me a lot and guys have been blocking shots, so it has been a good run the last seven or eight games.

"Now it is time to win more hockey games."

With the win Saturday, the Rangers have a chance to finish in third place in the Metropolitan Division, in which case they would play the Pittsburgh Penguins. If they remain the first wild card in the Eastern Conference, they would play the Florida Panthers. Either series would start on the road.

"You want to go in there feeling good about yourself and at the end of the day you don’t pick who you play," Rangers coach Alain Vigneault said. "Whoever it’s going to be, it’s between Pittsburgh and Florida. Whoever’s there we’ll be ready for it and we’ll compete hard."

Trailing 1-0 entering the second period, the Red Wings controlled the play and outshot the Rangers 16-7. Detroit tied the game when Sheahan deflected Pavel Datsyuk’s shot past Raanta for a power-play goal at 6:42.

With the teams skating 4 on 4 late in the first period, the Rangers opened the scoring when Dan Boyle and Derick Brassard had a 2-on-1 break. Boyle beat Howard with a wrist shot for his 10th goal of the season at 16:24.

The Red Wings nearly scored 2:48 into the game. Joakim Andersson poked a rebound past Raanta, but the goal was disallowed because the Red Wings were offside.

Raanta later made a strong save on Darren Helm with about 5 minutes left in the period.

Detroit was coming off a 5-2 loss to Boston on Thursday. Abdelkader, who is third on the team in goals, left the game against the Bruins in the third period with a lower-body injury but played against the Rangers.

Rangers forward Eric Staal left the game with 1:51 to go in the second period and didn’t return. It appeared that Jesper Fast accidently collided with Staal after a faceoff.

Vigneault said after the game that Staal was held out for precautionary reasons. "He should be fine," he said.

In addition to Staal, the Rangers were dealing with several other injuries. Forwards Mats Zuccarello and Viktor Stalberg missed the game with lower-body injuries. Zuccarello leads the Rangers with 61 points.

Defensemen Dan Girardi and Ryan McDonagh also were out. Girardi was injured Tuesday when he was hit into the end boards during a 3-2 victory against the Lightning. McDonagh hurt his hand blocking a shot in a 4-2 win Monday against the Columbus Blue Jackets.

Vigneault said Friday that Zuccarello, Stalberg and Girardi should be available for the start of the playoffs.

NOTES: The Rangers’ 99 wins combined over the past two seasons are the most in any two-season span in franchise history. The Rangers finished 27-10-4 at home. … The Red Wings have scored a power-play goal in nine of their past 11 games. … Every team in the league is playing on Saturday. The regular season ends on Sunday with two games.