China's Olympic swimming star Sun Yang has been banned from competition for eight years after being found guilty of breaking anti-doping rules

In a ruling that effectively ends the controversial 28-year-old's career if allowed to stand, the Court of Arbitration for Sport (CAS) ruling saddled him with the stiff penalty for missing an out-of-competition test for doping,

"This is unfair. I firmly believe in my innocence," the 28-year-old Sun told the  Xinhua News Agency.

"I will definitely appeal to let more people know the truth."

CAS accepted an appeal from the World Anti-Doping Agency (WADA) against a decision by swimming body FINA to clear Sun of wrongdoing for his conduct during the test in September 2018.

A FINA report said Sun questioned the credentials of the testers before members of his entourage smashed vials containing his blood samples with a hammer.

In a rare hearing in open court in November, evidence was presented of how a security guard instructed by Sun's mother broke the casing around a vial of his blood, while the swimmer lit the early-hours scene with his mobile phone.

"The athlete failed to establish that he had a compelling justification to destroy his sample collection containers and forego the doping control when, in his opinion, the collection protocol was not in compliance," CAS's three-judge panel decreed in a unanimous verdict.

China's greatest-ever swimmer, and one of its biggest sports stars, had asked CAS for the public trial.

A 10-hour hearing broadcast on the court's website showed Sun to be evasive at times under questioning that was hampered by severe translation issues between Chinese and English.

The CAS panel's verdict was delayed until all parties got a verified translation.

The two-metre Sun, the first Chinese swimmer to win Olympic gold, has long been a polarising figure.

Doping ban gets China's Sun Yang booted from pool for eight years_1
Silver medallist Mack Horton refused to share the podium with Sun Yang, now officially a drug cheat. Photo: Getty

Rivals branded him a drug cheat at the 2016 Rio de Janeiro Olympics, and Australia's Mack Horton and Britain's Duncan Scott refused to stand with him on medal podiums at the 2019 world championships.

Now banned until February 2028, the 28-year-old Sun cannot defend his 200-metre freestyle title in Tokyo, and a comeback at the age of 36 is almost inconceivable.

The World Anti-Doping Agency went to CAS after a FINA tribunal only warned Sun.

The first ruling was that anti-doping protocol was not followed, making the samples invalid, and cited doubts about credentials shown to him by the sample collection team.

"WADA … is satisfied that justice in this case has been rendered," the body's director general Olivier Niggli said in a statement.

Sun can now appeal to Switzerland's supreme court, but only on narrow procedural grounds.

His lawyers have already had three federal appeals dismissed on legal process issues.

-with AAP