Jordan Eberle had a hat trick and the New York Islanders beat the Detroit Red Wings 4-1 on Friday night to snap a four-game skid.

It was the third three-goal game of Eberle's career and his first since April 9, 2017, when he was with the Edmonton Oilers.

Leo Komarov added a late empty-netter for the Islanders. Semyon Varlamov stopped 21 shots.

New York Islanders right wing Jordan Eberle (7) watches as his second goal of the night goes into the net past Detroit Red Wings goaltender Jonathan Bernier during the second period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

New York Islanders right wing Jordan Eberle (7) watches as his second goal of the night goes into the net past Detroit Red Wings goaltender Jonathan Bernier during the second period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

Anthony Mantha scored for Detroit, which became the first team this season to be eliminated from playoff contention.

New York had scored only two goals in its previous four games, but Eberle got hot against the Red Wings, who have yielded more goals than any team in the league.

He got his first 5:45 into the game. The sequence began with a give-and-go behind the net between Matthew Barzal and Anders Lee, who skated to the circle and found an uncovered Ryan Pulock at the point. Eberle redirected Pulock's slap shot past Jonathan Bernier, who made 36 saves.

New York Islanders right wing Jordan Eberle (7) celebrates with center Mathew Barzal (13) after Eberle scored his second goal of the night against the Detroit Red Wings, during the second period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

New York Islanders right wing Jordan Eberle (7) celebrates with center Mathew Barzal (13) after Eberle scored his second goal of the night against the Detroit Red Wings, during the second period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

New York outshot Detroit 13-2 in the first period and finished the game with a 39-22 advantage in shots.

That meant Varlamov had a relatively easy night. His toughest save was a diving paddle stop on a 3-on-1 in the third period. Mantua's power-play goal with 2:35 left in the game ended the shutout bid.

Varlamov was aided by his defense, specifically Devon Toews, whose backcheck eliminated a breakaway chance from Dylan Larkin midway through the second period.

Detroit Red Wings center Frans Nielsen (81) and New York Islanders right wing Tom Kuhnhackl (14) go after the puck during the first period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

Detroit Red Wings center Frans Nielsen (81) and New York Islanders right wing Tom Kuhnhackl (14) go after the puck during the first period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

Minutes later, Eberle scored his second goal, a snap shot from the left circle.

He completed the hat trick on a power play with 36.3 seconds left in the game. Eberle has 13 goals this season.

NOTES: Before the game, the Islanders retired John Tonelli’s No. 27. Tonelli was an Islander from 1978-86 and assisted on Bobby Nystrom’s Stanley Cup-winning goal 7:11 into overtime of Game 6 against the Flyers in 1980, which began New York’s run of four consecutive championships. Among those at the ceremony were teammates Nystrom, Denis Potvin, Billy Smith, and Bryan Trottier; NHL Deputy Commissioner Bill Daly; Islanders co-owners Scott Malkin and Jon Ledecky; and Tonelli's wife Lauren, sons Jordan and Zach, and mother Joy. ... New York called up LW Otto Koivula and LW Andrew Ladd from AHL Bridgeport. ... Detroit scratched Ds Cody Goloubef and Jonathan Ericsson and LW Justin Abdelkader, while the Islanders scratched D Noah Dobson, C Derick Brassard and LW Ross Johnston.

New York Islanders defenseman Scott Mayfield (24) defends against Detroit Red Wings center Valtteri Filppula (51) behind the Islanders' net during the first period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

New York Islanders defenseman Scott Mayfield (24) defends against Detroit Red Wings center Valtteri Filppula (51) behind the Islanders' net during the first period of an NHL hockey game Friday, Feb. 21, 2020, in Uniondale, N.Y. (AP PhotoKathy Willens)

UP NEXT

Red Wings: Host Calgary on Sunday.

Islanders: Host San Jose on Sunday.

More AP NHL: https://apnews.com/NHL and https://twitter.com/AP_Sports