DENVER — Following a sensational goal by Colorado’s Nathan MacKinnon early in the first period, it took the Anaheim Ducks all of 51 seconds to retake the lead.

These days, the Ducks aren’t wasting much time collecting wins.

Rickard Rakell answered MacKinnon’s nifty goal with one of his own and the surging Ducks climbed into sole possession of the Pacific Division lead with a 4-1 win over the Avalanche on Thursday night.

John Gibson added 33 saves two days after he recorded a shutout, and Jakob Silfverberg scored for a second straight game to help the Ducks win for the fifth time in six games.

Ryan Kesler and Corey Perry also scored for Anaheim, which surpassed San Jose in the standings with 54 points.

The Sharks, with 52 points and two less games played, were idle Thursday.

“To have success in the league, you’ve got to do it more consistent and to a higher level than the opposition you’re playing against,” Anaheim coach Randy Carlyle said. “We make less mistakes than they do, usually you have a chance of winning.”

It wasn’t a problem against last-place Colorado.

Semyon Varlamov returned from his latest groin muscle injury to stop 28 shots. The Russian netminder dropped to 6-15 in his first start since Dec. 22.

The Avalanche looked fresh off their five-day break in the opening minutes and had the first five shots of the game. After that, it was more of the same for the NHL’s worst team.

“It’s the same story, I guess,” MacKinnon said. “We need to clean it up for sure.”

Silfverberg put the Ducks up 1-0 when he ripped his 13th goal of the season over Varlamov’s shoulder with 3:52 gone in the first.

That was the first of three goals in a 2:23 span.

The Avalanche were next, tying the game on a nifty breakaway goal from MacKinnon at 5:24. The All-Star center deked back and forth down the ice before he flipped a backhand past Gibson.

Anaheim retook the lead less than a minute later as Rakell let loose a chance from the top of the circle to end his five-game scoring drought.

“You want to have a good shift after they score a goal because that can be a momentum changer,” Rakell said of it. “It was nice to see it go in.”

The Ducks extended the lead to 3-1 6:03 into the second. Varlamov stretched his left leg out to make a pad save on Shea Theodore’s wrap-around chance, but Kesler found the loose puck at Varlamov’s skate and slammed it home.

In the third, Colorado couldn’t get back into the game despite two power-play opportunities and a 15-8 shooting advantage. The Avs pulled Varlamov with 2:51 remaining to get an extra attacker, but Perry made them pay with an empty-net goal with 1:36 left.

“We have to keep fighting and try to get better,” Colorado coach Jared Bednar said.

Anaheim improved to 9-8-6 on the road this season, while the Avs dropped to an NHL-worst 5-14-1 at home.

GETZLAF RETURNS

Ducks C Ryan Getzlaf (lower body) returned to the lineup after a four-game absence and had an assist.

“I felt pretty good considering where we’re at and coming back after a week off, essentially,” he said.

GAME NOTES: MacKinnon was named to his first All-Star Game on Tuesday, while Kesler and D Cam Fowler will represent Anaheim. … Avalanche RW Jarome Iginla appeared in his 1,514th career game, tying him with Steve Yzerman for 15th on the NHL’s all-time list. … The Ducks are hosting a “siblings trip” while visiting Colorado and Arizona. It includes six sisters, six brothers and one mother, according to the team’s website.

UP NEXT

Ducks: At Arizona on Saturday night to conclude a two-game road trip.

Avalanche: Continue their four-game homestand against Nashville on Saturday.