DENVER (AP) Francois Beauchemin's shot and a little luck gave the Colorado Avalanche an important victory.
Beauchemin scored a go-ahead goal with 31.7 seconds left in the third period to lift the Colorado Avalanche to a 2-1 victory over the Buffalo Sabres on Wednesday night.
Alex Tanguay had a goal and an assist and Semyon Varlamov had 27 saves for Colorado. Beauchemin also had an assist.
The Avalanche, who scored twice in the third, went ahead when Beauchemin's shot from the point went off Sabres defenseman Mark Pysyk and beat goalie Robin Lehner high for his sixth of the season.
''It was a nice pass off the wall from Tangs and I was able to keep it in,'' Beauchemin said. ''I had a lane at the net and I just threw it and it hit something in front. Sometimes that's all you need to get the goal. That's what we needed to get that win.''
The Sabres pulled Lehner for an extra attacker but didn't get a shot on goal.
''We're battling and battling and then they get a bounce. It's tough,'' Lehner said. ''I thought we played a good road game and I think everyone battled and played hard. We deserved at least a point out of this one.''
Buffalo's loss spoiled the return of Ryan O'Reilly, who played six season in Colorado and was facing his former team for the first time since being traded in the offseason.
''Once you got in the ice it's just another game,'' O'Reilly said. ''You try to win. It wasn't too weird I guess. It was just different.''
O'Reilly had an assist, Evander Kane scored and Lehner finished with 33 saves for Buffalo.
O'Reilly was drafted in the second round in 2009 and made the team that fall at age 18. He was a central piece in Colorado's rebuilding efforts, but the two sides couldn't come to terms on a contract extension last summer.
O'Reilly would have been eligible to become an unrestricted free agent after this season, and the Avalanche didn't want to lose him without getting something in return. They sent him to Buffalo along with Jamie McGinn for defenseman Nikita Zadorav, center Mikhail Grigorenko the rights to J.T. Compher and a 2015 second-round draft pick.
O'Reilly then signed a seven-year, $52.5 million contract with Buffalo that starts next season. He has responded well to his new team by leading the Sabres in goals (17) and points (40).
He got one of those points on Kane's power-play goal late in the second period that gave the Sabres a 1-0 lead. He was lightly booed throughout the game.
''A small boo,'' he said. ''It is what it is.''
Colorado pressed for the tying goal, and after failing to get it on a 4-minute power play early in the third Tanguay tied it with his third of the season at 9:23.
It was Tanguay's first goal since Oct. 30.
''It's been quite a while. I haven't been on the scoresheet as much as I would like, but a little before Christmas I started to play a little bit better,'' he said. ''I just can't get in a groove and hopefully this will spark me to help the team a little bit more.''
NOTES: Buffalo C Sam Reinhart left the game in the second period with an upper body injury. He did not return. ... Referee Dave Jackson left the game late in the second period after being hit in the head with a puck. He returned at the start of the third. ... Avalanche D Erik Johnson has begun skating. Johnson suffered a knee injury against the Kings on Jan. 4 and has not played since.