Updated

Ryan O'Reilly broke a tie 37 seconds into the third period and Semyon Varlamov stopped 27 shots, helping the Colorado Avalanche beat the Anaheim Ducks 4-1 on Monday night in a game between two surging teams trying to climb back into playoff contention.

Cody McLeod, Matt Duchene and Jay McClement also scored for the Avalanche, who won their fourth straight to move into a tie with Dallas for the eighth and final playoff spot in the Western Conference.

Bobby Ryan had a goal for a weary Ducks squad that was playing for a third time in five nights. The fatigue showed in the third period when Anaheim surrendered three goals, including two within a span of 2:18 to help Colorado end a six-game skid to the Ducks on home ice.

Buried in the standings on New Year's Day, the Ducks have gone 17-5-4 since that point to work their way back into the thick of the postseason race.

Varlamov has given up just two goals in his last three contests, including a shutout at Columbus last Friday.

Earlier in the day, the Avalanche orchestrated their second trade in a week. They acquired forward Jamie McGinn and two prospects from San Jose in exchange for T.J. Galiardi, Daniel Winnik and a seventh-round pick in the 2013 draft.

McGinn didn't make it to the Mile High City in time to play Monday night. The 23-year-old did take a tiny hop back in the standings, though, with the Avs trailing the Sharks by a point.

The last trade the Avs pulled off ignited their stagnant offense. Steve Downie has contributed two goals and five assists since coming over in the deal with Tampa Bay last Tuesday. He had two assists against Anaheim.

Colorado also had Milan Hejduk back on the ice after he sat out Saturday's 4-3 win in Detroit with a groin injury.

Peter Mueller returned as well, perhaps even a little ahead of schedule. The Avs were planning to hold out Mueller another game, but he was pressed into action with Galiardi and Winnik heading out of town. Mueller was activated off injured reserve after sitting out six games with a torso ailment.

The Ducks didn't make any moves at the trade deadline, preferring to stick with the squad that's worked them back into contention. Anaheim coach Bruce Boudreau said he's never seen a tighter bunch, especially since they've had to skate with a playoff-mentality since Jan. 1.

O'Reilly scored the decisive goal thanks to a bit of a lucky bounce. Gabriel Landeskog tried to corral a pass down low, only to have it bound away and straight to O'Reilly, who knocked it past Jonas Hiller, who's been difficult to beat during the Ducks' recent stretch.

Two minutes later, Paul Stastny and Duchene were on a breakaway with only Cam Fowler between them. Fowler tried to slide across the ice to take away the passing lane, but Stastny hopped a pass over Fowler and straight to Duchene, who knocked it in for his first goal since Dec. 23.

Duchene just recently returned after missing 20 games with a knee injury.

Varlamov had quite a second period, making a glove save on a shot from Fowler and later stuffing Teemu Selanne. The young Russian goaltender also caught a bit of a break when he blocked a shot by Ryan, only to have the puck flutter up into the air. Before it had a chance to land in the net, Avs defenseman Matt Hunwick knocked the goal off its moorings and sent the puck bounding away.

But Ryan would get his revenge, sending a wrist shot through the pads of Varlamov late in the second period to tie the game.

The Avalanche got on the board midway through the first period when a puck caromed off a Ducks skate and straight to McLeod, who backhanded a shot past Hiller.

NOTES: The prospects the Avs acquired Monday were Mike Connolly and Michael Sgarbossa. ... Avs D Stefan Elliott is wearing a helmet with a full cage after taking a puck to the face against Detroit and needing several stitches. ... Along with Downie, Landeskog and D Jan Hejda also had two assists for Colorado.