DENVER — Connor McDavid had his third hat trick of the season, and the Edmonton Oilers beat the Colorado Avalanche 4-2 on Sunday to snap a six-game losing streak.

McDavid now has 11 goals in the last nine games and two hat tricks. His first two goals tied the game, and his last one was into an empty net at 18:34 of the third.

He has five goals in two games against the Avalanche this season.

Ryan Strome also scored and Cam Talbot had 24 saves for the Oilers, who snapped Colorado’s 10-game home winning streak.

The Avalanche got goals from Tyson Jost and Alexander Kerfoot, and Semyon Varlamov had 36 saves, but Colorado couldn’t take advantage of the return of Nathan MacKinnon.

MacKinnon missed eight games with a left shoulder injury suffered in Vancouver on Jan. 30. He was second in the league in scoring when he was injured. He entered Sunday tied for 16th with 61 points.

He had a chance to tie it late, but his shot with less than four minutes left hit the post. Moments later, McDavid sealed it with his team-leading 26th goal.

PENGUINS 5, BLUE JACKETS 2: Riley Sheahan scored two goals in the first period and rookie Tristan Jarry made 35 saves in Pittsburgh’s victory at Columbus.

Jake Guentzel had a goal and two assists, and Brian Dumoulin and Zach Aston-Reese also scored for the Penguins. They have won five straight and 10 of their last 12. The win in front of a sellout crowd at Nationwide Arena moved them past Washington into first place in the Metropolitan Division.

Artemi Panarin and Alexander Wennberg scored for Columbus.

FLYERS 7, RANGERS 4: Travis Konecny broke a tie late in the second period and Alex Lyon made 25 saves in relief to help Philadelphia win at New York.

Claude Giroux and Jori Lehtera scored in the third to finish off Lyon’s first NHL win. Rangers goalie Henrik Lundqvist allowed all seven goals.

Andrew MacDonald, Scott Laughton, Brandon Manning and Nolan Patrick also scored for Philadelphia. The Flyers have won six of seven.

Kevin Hayes, Rick Nash, Mats Zuccarello and Peter Holland scored for New York.

DEVILS 3, HURRICANES 2: Taylor Hall scored on a rebound with 22 seconds left in overtime to lift visiting New Jersey past Carolina and extend his NHL-best points streak to 11 games.

Keith Kinkaid stopped 40 shots, and Nico Hischier and Pavel Zacha added goals for the Devils. Teuvo Teravainen and Jeff Skinner scored for Carolina.

MAPLE LEAFS 3, RED WINGS 2: Auston Matthews scored with 30.2 seconds left to give Toronto a win at Detroit.

Matthews snapped a high shot into the roof of the net from a sharp angle for his 27th goal of the season.

James van Riemsdyk and Mitch Marner also scored for Toronto, and Curtis McElhinney made 27 saves.

Anthony Mantha and Henrik Zetterberg scored for Detroit.