Chinese swimmer Sun Yang has been banned for eight years after breaking anti-doping rules in a late-night incident in which a blood sample container was smashed with a hammer.

The Court of Arbitration for Sport (CAS) found the three-time Olympic champion guilty of refusing to cooperate with sample collectors during a visit to his home in September 2018 that turned confrontational.

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.

AP

"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," the CAS panel of three judges agreed in a unanimous verdict.

China's greatest ever swimmer, and one of its biggest sports stars, had asked CAS for a 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.

Wow. China’s most famous athlete Sun Yang gets eight year doping ban after WADA appealed decision by swimming’s governing body FINA to let him off pic.twitter.com/Ye271HBNam — tariq panja (@tariqpanja) February 28, 2020

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

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.

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

READ MORE Translation difficulties hinder Chinese swimmer Sun Yang's doping appeal testimony

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 on narrow procedural grounds.

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