(CNN) Triple Olympic swimming champion Sun Yang has been banned from the sport for eight years for missing an out-of-competition doping test, the Court of Arbitration for Sport (CAS) said on Friday.

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

The 28-year-old is one of China's top athletes, having won two gold medals at the 2012 London Olympic games and another in Rio de Janeiro in 2016.

The eight years is the maximum ban that CAS can hand out. It's the second ban Sun has received for doping, after the Chinese swimmer served one in 2014.

Sun poses with his gold medal he won during the 2016 Olympics.

'Justice rendered'

WADA said it was "satisfied that justice in this case has been rendered."

"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," said WADA in a statement.

"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 and the related International Standard for Testing and Investigations.

The ban means Sun -- who is nicknamed the "Underwater Meteor" -- won't be able to compete at the 2020 Olympics in Tokyo.

Sun won a gold medal in the 200m freestyle at the 2019 World Aquatic Championships in South Korea, but British swimmer Duncan Scott, who won joint-bronze, refused to shake hands or pose for pictures with the Chinese swimmer -- only two days after Australian swimmer Mack Horton chose not to share the podium with Sun.

Before the 400m freestyle race at the 2016 Olympics in Rio de Janeiro, Horton had labeled Sun a "drug cheat."

In a statement, Scott said he supported the ruling handed down by CAS.

"I fully respect and support the decision that has been made and announced by the Court of Arbitration for Sport this morning," he said. "I believe in clean sport and a level playing field for all athletes and I trust in CAS and WADA to uphold these values."

The 28-year-old won 200m freestyle gold at Rio 2016.

'Snowball effect'

Olympic champion Chad le Clos told CNN that he believed he "deserved" the gold medal he was denied after finishing second behind Sun in the 200m freestyle in 2016.

"It's obviously not for me to judge but of course, I believe that I deserve that gold medal because back in 2016, it was actually a personal best and actually a South African record," Le Clos told CNN Sport's Amanda Davies.

"I feel like it's not only about me. It's about James Guy who finished fourth in that race, whoever came ninth and whoever came 17th missed out on Olympic finals and semifinals. It's a snowball effect.

"At the end of the day, you're killing generations of swimmers by not punishing these drug cheats because for example, if Guy had got bronze and on the podium, it could have changed his life.

"If I hadn't had got gold in London and I had gone into Rio as my first race, and I had got a gold medal, it would have changed my life. It's not just me but they should go and have a look at some of the stuff that's happened."

Gold medalist Sun Yang of China (left) and bronze medalist Duncan Scott of Great Britain (right) interact during the medal ceremony for the Men's 200m Freestyle Final.

'This is unfair'

Chinese state-run Xinhua news agency quoted Sun as saying that he will "definitely" appeal the CAS ruling. "This is unfair," Sun told Xinhua. "I firmly believe in my innocence."

Sun himself confirmed to his 33 million followers on Weibo that he will be appealing the decision.

"I am shocked and angry -- I don't understand," the swimmer wrote in a post on the Chinese social media platform. "I firmly believe my innocence and that truth will prevail over lies."

The Chinese Swimming Association expressed its "deep regret" over CAS' decision and voiced its support for Sun to "continue to safeguard his legitimate rights through legal means," according to state media.

CAS Secretary General Matthieu Reeb reads the decision of the Court on the case of Sun.

The national organization said in a statement that the activities in September 2018 by "untrained and unqualified personnel" targeting Sun are "illegal and invalid." It added that WADA and other agencies should improve and perfect their rules, and stop ignoring athletes' legitimate rights.

"They can't just allow anyone to engage in work that's as intimately related to athletes' vital rights as anti-doping testing," it said.

However, WADA Director General Olivier Niggli called the ban a "significant result."

"WADA decided to appeal the original FINA ruling having carefully reviewed it and having concluded that there were a number of points that seemed to be incorrect under the Code.

"Today's CAS ruling confirms those concerns and is a significant result. We will now need to take time to review the decision in full, and we will continue to review diligently all anti-doping decisions taken by Code Signatories to ensure they are in line with the Code and, when warranted, to exercise our independent right of appeal."