NEW YORK (AP) — Steven Stamkos scored three goals for his first hat trick of the season, and the Tampa Bay Lightning rallied to beat the New York Islanders 6-4 Friday night in the season finale.

Corey Perry, Ryan McDonagh and Brandon Hagel also scored for Tampa Bay, which trailed by two before scoring five times in the third period. Ondrej Palat added three assists and Andrei Vasilevskiy stopped 33 shots as the Lightning (51-23-8) secured third place in the Atlantic Division. Tampa Bay, which will face Toronto in the first round, began the day one point ahead of Boston.

“We talked about going out and just playing a good third period and trying to gain some momentum heading into the playoffs,” Stamkos said. “That was a good response by our group and always nice to feel good heading into the fun part of the season.”

Jean-Gabriel Pageau, Kieffer Bellows, Josh Bailey and Zdeno Chara scored for the Islanders, who will miss the playoffs for the first time since 2018. New York (37-35-10) reached the Stanley Cup semifinals the last two years before losing to the Lightning, who went on to win the finals each time. Ilya Sorokin had 28 saves.

“Obviously, we didn’t have a third period that we wanted,” Islanders coach Barry Trotz said. “I think we stopped moving the puck, stopped skating. I think we got a little stunned by their power play, how the puck was moving. If you look tonight, their big guys, when they needed a push in the third those names are one after another.”

Perry got the Lightning's comeback started as he capitalized on a power play at 1:21 of the third to cut New York's lead to 3-2. Victor Hedman extended his career-high assist streak to eight games and Kucherov stretched his point streak to nine games with assists on Perry’s 19th goal of the season.

The Lightning have tallied a power-play goal in a season-high eight consecutive games and have scored multiple goals on the man advantage in four of their last six games.

McDonagh tied it at 10:10 as his shot slid between the legs of Sorokin. Pat Maroon, skating in his 200th game with Tampa Bay, assisted on the play.

Stamkos wired a wrist shot past Sorokin's glove with 8:47 left to put the Lightning ahead. The Tampa Bay captain also set a franchise record by extending his multi-point game streak to nine games.

“We shot a lot more, probably a little bit more directed pucks to the net,” Lightning coach Jon Cooper said. “And we had Steven Stamkos on our side, so that helped.”

Stamkos made it 5-3 with his third of the night and 42nd of the season with 2:10 remaining, converting on a 2-on-1 with Ondrej Palat.

Chara scored on a slap shot with 44 seconds left to pull the Islanders within one. The 45-year-old defenseman received a standing ovation from the crowd and his teammates in what could be his final NHL game.

“I can’t really describe it, I was getting chills,” Chara said. “It was a spectacular moment. I will cherish that for the rest of my life. Very classy.”

Hagel sealed the game with an empty-netter 19 seconds later.

Pageau opened the scoring when he redirected Noah Dobson’s shot past Vasilevskiy 32 seconds into the game. Anders Lee also assisted on Pageau’s 18th of the season.

Stamkos tied it with 8:03 left in the first, reaching 40 goals for the sixth time in his career and first time since the 2018-19 season. He also surpassed 100 points for the first time in his career, finishing with 106 (42 Goals, 64 assists).

The Islanders took a 3-1 lead with two goals in the second period.

Bellows broke a 1-1 tie with a strong power move at 9:35. Vasilevskiy stopped the initial shot from the 23-year-old, but the puck deflected off Lightning defender Cal Foote before finding the back of the net. In 44 games this season, Bellows registered six goals and 13 assists.

Bailey converted on the power play with 1:12 left in the period. New York has converted on seven of the last 11 opportunities on the man-advantage and tallied a power-play goal in four straight games.

Lightning forward Brayden Point did not play, and Tampa Bay skated with 11 forwards and seven defensemen.

The Islanders completed their first season at UBS arena with a 20-16-5 record on home ice.

IRON MEN

Parise, 37, became the only Islander to play in all 82 games this season. The veteran forward signed with New York this past summer after the Minnesota Wild bought out the final four years of a 13-year contract that was signed in 2012. Parise signed a one-year contract extension with New York last month. ... Hedman, Alex Killorn and Perry were the only members of the Lightning to play in all 82 games.

OVER-50 CLUB

Dobson collected his 51st point of the season with the primary assist on the Islanders’ opening goal and became the first Islanders defenseman to total more than 50 points since Mark Streit had 56 in 2008-09. He is also the second defenseman, 22 years or younger, to record 50-plus points, joining Denis Potvin who accomplished that feat three times.