DENVER (AP) -- Matt Nieto capped off his first career hat trick on an empty-netter in the closing seconds, Semyon Varlamov stopped 34 shots and the injury-riddled Colorado Avalanche ended a three-game skid with a 5-3 victory over the Dallas Stars on Tuesday night.
Gabriel Landeskog had a goal and an assist, and Mark Barberio contributed another tally in his 200th career NHL game.
Jamie Benn, Brett Ritchie and John Klingberg scored for the Stars, whose four-game winning streak was halted. Starting goaltender Ben Bishop was replaced by Kari Lehtonen early in the second period after giving up three goals on 17 shots.
The Avalanche looked refreshed after a few days off from action. They controlled the tempo until the third period, when the Stars began to take charge. Benn's liner from near the blue line made it 4-3 with 9:48 remaining.
Mattias Janmark nearly tied it moments later, only to have Varlamov slide over and stop the shot with his right shoulder.
Lehtonen was pulled for an extra skater with around 30 seconds left. Nieto sealed the win with his goal with 3.1 seconds remaining.
After Landeskog's goal at 4:04 of the second period gave the Avalanche a 3-2 lead, Bishop was replaced by Lehtonen in a coach's decision that didn't sit well with the starter.
"There was no reason for me to come out," Bishop said. "It's a 3-2 hockey game with more than half the game left. I'm not very happy with the decision. There's still a lot of hockey left. … I felt good. Not very happy with the decision."
Barberio gave the Avalanche a big two-goal cushion on his blast with 9.8 seconds left in the second.
The ailing Avalanche were missing J.T. Compher (hand), Tyson Jost (lower body), Colin Wilson (hip) and Patrik Nemeth (lower both). Nieto made the most of his increased ice time after not playing the last two games.
Nieto was all over the place, including near the goal in the second period when Blake Comeau wrestled the puck away from Bishop behind the net. Comeau's feed bounded in front before coming Nieto's way.
Benn made a nifty play at 8:03 of the first period when he managed to keep a lofted puck in the zone by stopping it with his glove. Despite being surrounded by three Avalanche players, he lined a shot through the pads of Varlamov.
Nieto tied the game moments later with his first goal of the season.
Colorado withstood a four-minute power play late in the first period after Alexander Kerfoot hit Tyler Pitlick in the face with his stick and drew blood.
The Avalanche improved to 3-1 at home this season. They were 13-26-2 at the Pepsi Center season ago.
"We owe (the fans) a good home record," Nathan MacKinnon said. "We weren't very good last year."
NOTES: Benn finished with two assists after his third period goal was changed to Klingberg following the game. … Stars D Stephen Johns went to the locker room with an upper body injury in the first period. He took a hit from Avs F Matt Duchene, who drew a penalty for boarding. … F Tyler Seguin finished with two assists. He now has four goals and four assists over the last five games. … Colorado D Tyson Barrie had an assist to extend his point streak to a career-high six straight games. … Comeau had three assists.
Stars: Travel to Edmonton on Thursday for the second contest in a five-game trip.
Avalanche: A back-to-back -- at Vegas on Friday and home against Chicago the next night.