Russia's desperate attempt to get 45 banned athletes including several medal favorites into the Pyeongchang Olympics failed just hours before Friday's opening ceremony.
The International Olympic Committee had banned Russia because of a massive doping scheme at the 2014 Sochi Games, but gave individual athletes the chance to apply for admission to compete as "Olympic Athletes from Russia." There were 168 Russians who passed the vetting process. Dozens more filed appeals with the Court of Arbitration for Sport.
On Friday, the court upheld the IOC's right to decide who can compete.
Anti-doping officials praised the ruling, which is a heavy blow to Russian medal chances.
"That's it. The story is over," Russian delegation spokesman Konstantin Vybornov said.
After two days of hearings, the CAS panel ruled that the commissions that evaluated whether Russian applicants were eligible did not act in a "discriminatory, arbitrary or unfair manner."
CAS secretary general Matthieu Reeb read from a statement and declined to take questions, saying the IOC process "could not be described as a sanction but rather as an eligibility decision."
The IOC and the World Anti-Doping Agency welcomed the decision. The IOC said the decision "supports the fight against doping and brings clarity for all athletes."
WADA president Craig Reedie described it as "absolutely correct."
Among those excluded are six-time gold medalist Viktor Ahn, the short track speedskater whose return to his native South Korea for the Olympics had been eagerly anticipated by local fans.
Also out are cross-country skiing gold medalist Alexander Legkov and skeleton gold medalist Alexander Tretiakov, as well as potential medal contenders in biathlon, luge and bobsled.
Three former NHL players Sergei Plotnikov, Anton Belov and Valeri Nichushkin also lost appeals, though it was widely considered unlikely they would have played even if they had been successful because the Russian roster is already full.
U.S. Anti-Doping Agency chief executive Travis Tygart said the decision was "a small glimmer of hope in an otherwise dark and sordid affair."
"You hope justice has been served but how some of these athletes can keep dirty medals from Sochi but be excluded now is hard to reconcile," Tygart said. "And why the IOC rushed the process on the Sochi medal decisions is unexplainable and a tragedy for clean athletes."
In a telephone interview, Reedie told The Associated Press: "I am delighted at the decision and the way they expressed it."
"They have quite clearly understood that there was systemic manipulation of the anti-doping process," Reedie said. "It means the games can proceed. Athletes can get their heads down and go. This particular issue is now behind us."
The IOC's vetting process was designed to exclude Russian athletes from the games if IOC officials weren't sure they were clean, even if they hadn't been banned for doping.
The "Olympic Athletes from Russia" will compete in neutral uniforms under the Olympic flag in a decision designed to balance the rights of individual athletes with the need for a strong deterrent to doping.
As well as the 45 athletes, the ruling covers a luge coach and a skeleton coach.
The IOC has refused to comment on individual Russian athletes but says it decided who to exclude using a newly obtained Moscow laboratory database with evidence of past doping offenses.
It refused to clear some Russians even after their disqualifications from the 2014 Olympics were lifted by CAS last week.
Stephen Hess, an international sports lawyer based in Colorado Springs, Colorado, said the decision was a victory for the IOC.
"There is no absolute right to get an invitation from the IOC to come to the Olympics," Hess said in a telephone interview. "That was within the IOC's discretion, and they didn't exercise it arbitrarily. If Russia had an Olympic team, CAS might have said: 'IOC, the Russians can put them on their own team. You can't keep them out.' But Russia doesn't have an Olympic team."
Jim Walden, the lawyer for Russian whistleblower Grigory Rodchenkov, renewed calls for IOC President Thomas Bach to resign "for the sake of the Olympic ideal."
Walden has accused the IOC and CAS of being "complicit in enabling Russian doping" for not implementing strong punishments for Russian athletes, including a blanket ban.
Friday's verdict, he said, is "a small semblance of justice for clean athletes."
Angela Ruggiero of the IOC athletes' commission said the decision provided clarity for all competitors.
"The message we're sending to athletes now is, the decision's been made, you should be incredibly confident that every athlete, including the Olympic Athletes from Russia, have had to clear incredibly high hurdles to get here," Ruggiero said.
U.S. athletes also welcomed the end to uncertainty around the participation of some Russian athletes.
"That is great news," said U.S. women's skeleton athlete Katie Uhlaender, who placed fourth in the Sochi Olympics one spot behind bronze medalist Elena Nikitina, who was one of the 45 appealing her ban.
U.S. bobsledder Nick Cunningham said he has tried to not focus on the will-they-or-won't-they drama surrounding the Russians.
"If dirty athletes are taken out, then clean athletes will prevail," Cunningham said. "That's what I hope."