Avalanche goalie Semyon Varlamov underwent hip surgery in Vail Thursday morning, and his 2016-17 season is over.

The operation was an attempt to eliminate the troublesome groin muscle issues that periodically have plagued Varlamov in recent years and made him unavailable to the Avalanche for several stretches this season. Hip specialist Marc Philippon performed the approximate three-hour surgery, beginning at 9:30 a.m., and the Avalanche said it went well.

Before the surgery, Avalanche general manager Joe Sakic noted Varlamov “has been dealing with groin and hip issues for some time now.” He added, “After further evaluation from our team doctors, it was determined that the best road to recovery was surgery. Doing this procedure at this time ensures that Semyon will be fully healthy for the start of training camp.”

Last week, when Varlamov suffered a flareup of the groin problems, the Avalanche said that pending additional assessment, the Russian goalie was being shut down at least through the all-star break. The All-Star Game game is Sunday in Los Angeles, and the Avalanche resumes its schedule Tuesday at Anaheim.

On Wednesday morning at the Pepsi Center, hours before the Avalanche’s 3-2 loss to the Vancouver Canucks, Colorado coach Jared Bednar was asked if there was an update on Varlamov’s status, and also ultimately about whether surgery was a possibility, plus whether it was conceivable Varlamov might be shut down for the rest of the season. While seeming to acknowledge those were possibilities, Bednar was non-committal, saying the team trainers and doctors were talking about options.

The answer came Thursday.

The move means the Avalanche will go forward with Calvin Pickard and Spencer Martin in net, almost certainly for the rest of the season. Martin, 21, was summoned from San Antonio of the American Hockey League to back up Pickard during Varlamov’s absences and he didn’t play until after his fourth callup, when he was in goal for back-to-back games against San Jose Saturday and Monday.

Colorado’s third-round pick in the 2013 draft, Martin Thursday returned to San Antonio, but that was only so he could play for the Rampage against the Ontario Reign Friday night, and he will be back with the Avalanche after the all-star break. He will go into the weekend with a 15-9-2 record, a 2.62 goals-against average and a .915 save percentage in 27 games with the Rampage this season. Martin was selected for the Pacific Division team for Monday night’s AHL All-Star Classic, but has been replaced.

Rampage backup Jeremy Smith also joined the Avalanche for another five-game stretch when Varlamov was out, but didn’t play.

In July 2011, the Avs acquired Varlamov from Washington for first- and second-round picks in the 2012 draft and signed him to a three-year, $8.5 million contract. He signed a five-year, $29.5 million extension in early 2014.

Varlamov, 28, was a finalist for the Vezina Trophy in 2013-14, when he helped carry the Avalanche to a stunning 112-point season in the first year of the Sakic-Patrick Roy regime — a partnership that ended when Roy resigned as coach last August. While he has had terrific stretches since then, Varlamov also has been mercurial and intermittently troubled by the groin muscle issues.

This season, his 3.38 goals-against average is the worst among the 47 NHL goaltenders with enough appearances to qualify for the rankings and his .898 goals-against average is 42nd. In his defense, the team in front of him is struggling, with the worst record in the NHL (13-31-2) and a substandard corps of defensemen. Pickard’s numbers are only marginally better.

Varlamov is under contract for two more seasons, with a $5.9 million annual cap hit. He possibly could be left unprotected in the upcoming expansion draft, but given his salary and health issues, it’s extremely unlikely that Las Vegas Golden Knights — run by former Washington general manager George McPhee — would claim him.