BEIJING (AP) — The judges who let Russian figure skater Kamila Valieva continue to compete at the Beijing Olympics blamed anti-doping officials in a legal document published Friday for a “failure to function effectively.”

The Court of Arbitration for Sport explained its verdict in the case that has dominated Olympic headlines for more than a week in a 41-page document, citing the “untenable delay” at the testing laboratory in Sweden as a reason for letting the 15-year-old Valieva skate in the women's competition.

Valieva’s positive test for a heart medication was only revealed during the Olympics despite her urine sample arriving at the Stockholm lab on Dec. 29. The lab’s staffing was affected by the COVID-19 pandemic.

The full verdict was published early Friday, hours after the 15-year-old Valieva’s mistake-filled free skate dropped her from the lead to finish fourth in the women’s individual event at the Beijing Games.

Valieva was cleared to skate by an urgent CAS ruling Monday after an appeal hearing that started Sunday night and ended at around 2 a.m. Monday. The World Anti-Doping Agency and International Olympic Committee appealed against the decision by the Russian anti-doping agency to lift Valieva’s initial suspension, which had been triggered by the positive test.

“Put simply, athletes should not be subject to the risk of serious harm occasioned by anti-doping authorities’ failure to function effectively at a high level of performance and in a manner designed to protect the integrity of the operation of the Games,” the verdict stated.

Valieva’s lawyers suggested she tested positive “as a result of domestic interaction with her grandfather who uses ‘Trimetazidine’ after heart replacement surgery.”

The CAS document shows they suggested it could have happened “through dishes used by the Athlete and the Athlete’s grandfather (through drinking liquid from the same glass, as well).”

Valieva's status as minor, or “protected person,” under the world anti-doping code gave her an advantage. The standard of proof for a protected person is lower than for an adult making the same claim about testing positive because of a contaminated product.

Valieva tested negative in doping controls taken on Oct. 30, Jan. 13 at the European Championships in Estonia, and Feb. 7 in Beijing. That day, her skating helped Russia win the team event. The positive test was revealed a day later.

WADA countered the judges' arguments Friday, insisting they had effectively overturned one aspect of the World Anti-Doping Code by saying an interim ban was optional rather than mandatory for a protected minor who tested positive for a banned substance.

“This is not what the Code says, not what the Code drafters intended and was never proposed by any of WADA’s stakeholders during the three rounds of Code consultation,” the Montreal-based agency said in a statement.

WADA again said Russian anti-doping officials should share blame for the delayed test result from Stockholm because they “did not flag the high-priority nature of the sample despite being informed by the laboratory of delays being caused by a COVID-19 outbreak among its staff."

___

More AP Olympics: https://apnews.com/hub/winter-olympics and https://twitter.com/AP_Sports