The World Anti-Doping Agency (WADA) on Friday accused the Court of Arbitration for Sport (CAS) of ignoring the world anti-doping code when it upheld the Russian anti-doping authorities' decision to lift the provisional suspension of Russian teenage figure skater Kamila Valieva at the Beijing Olympics.

CAS ruled on Monday that Valieva should be allowed to compete in the women's competition despite having failed a drug test at her national championships last December.

The result was only revealed on Feb. 8, a day after Valieva helped the Russian Olympic Committee win the team event at the Beijing Games.

READ: IOC president Bach disturbed by Valieva's meltdown, hits out at entourage

In its reasoned decision published on Friday, CAS said it went with the Disciplinary Committee (DADC) of the Russian Anti-Doping Agency's argument that the 15-year-old Valieva, being a 'protected person', did not need to meet the usual standards to prove that she did not take the banned heart drug she tested positive for willingly.

"The Committee (DADC) considered that the Athlete established, at least at the 'reasonable possibility' level and at the maximum at the 'balance of probability' level, that the violation resulted from the ingestion of a contaminated product," CAS said.

Valieva's defence had argued that the positive test resulted from a mix-up with her grandfather's heart drug, trimetazidine.

"In the DADC’s opinion, in fact, the Athlete could have consumed a product which has been contaminated by the drugs used in her inner circle," CAS continued.

That explanation did not satisfy, WADA, who said that a 'protected person' (i.e. an Under-16 athlete) should not be treated differently as far as provisional suspensions are concerned.

READ: Shcherbakova wins figure skating gold as Valieva collapses

"In effect, by making this award, the CAS Panel has re-written the Code to say that mandatory provisional suspensions for ‘protected persons’ shall now be considered as optional provisional suspensions," WADA said in a statement.

"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.

"This re-writing of the Code, which would apparently allow ‘protected persons’ to continue competing after testing positive for non-specified substances without any clarification of the circumstances, risks undermining the integrity of sporting competition and the confidence of athletes that they are competing on a level playing field."

READ: Speculation around Russian Valieva must be tough for teenager- IOC

Valieva topped the women's competition standings after the short programme on Tuesday but crumbled under pressure in Thursday's free skate and slipped down to fourth.

Her 17-year-old compatriot Anna Shcherbakova won the event.