During an out-of-competition test in September 2018, the three-time Olympic champion questioned the anti-doping testers' qualifications after submitting a sample which was then destroyed.
“The athlete failed to establish that he had a compelling justification to destroy his sample collection containers and forgo the doping control when, in his opinion, the collection protocol was not in compliance,” the court said.
FINA issued a warning to him but the World Anti-Doping Agency (WADA) appealed the case to CAS.
CAS ruled in favour of WADA, saying: "The CAS Panel unanimously determined, to its comfortable satisfaction, that the Athlete violated Article 2.5 FINA DC (Tampering with any part of Doping Control)."
It gave Sun the maximum possible suspension.
FINA issued a short response to the decision, stating: "FINA has noted the judgement published by CAS today in the case of WADA versus Chinese swimmer Sun Yang."
In response, WADA said in a statement:
"The World Anti-Doping Agency (WADA) welcomes the ruling of the Court of Arbitration for Sport (CAS) in relation to WADA’s appeal against the Fédération Internationale de Natation (FINA) disciplinary panel decision in relation to an incident that led to a doping control involving Chinese swimmer Sun Yang not being completed as planned.
"WADA had lodged the appeal on the basis that Sun Yang voluntarily refused to submit to sample collection as per the terms of the World Anti-Doping Code (Code) and the related International Standard for Testing and Investigations. WADA notes the sanction handed down by CAS and is satisfied that justice in this case has been rendered."
At the 2019 World Championships Sun won gold medals in 200m and 400m freestyle.
Sun Yang said he will "definitely" appeal to the Swiss Federal Tribune against the CAS decision: "This is unfair. I firmly believe in my innocence," he told Xinhua. "I will definitely appeal to let more people know the truth."