"Pride of China" Sun Yang is "a victim of political posturing" and did not break doping rules, his lawyer said, after a ban of more than four years forced the swimming star out of the Tokyo Olympics.

The three-time Olympic champion's career was in tatters on Wednesday after the Court of Arbitration for Sport's suspension for refusing to give a sample to doping inspectors.

At the end of a long-running and controversial case, the Lausanne-based court reduced its original ban of eight years after the 29-year-old Sun appealed to Switzerland's federal supreme court over alleged bias.

The new ban of four years and three months, backdated to February 2020, rules the 1,500m freestyle world record-holder out of next month's Tokyo Olympics and the 2022 Asian Games in his home city of Hangzhou.

A doping ban has ruled Chinese swimmer Sun Yang out of the Tokyo Olympics
A doping ban has ruled Chinese swimmer Sun Yang out of the Tokyo Olympics AFP / Manan VATSYAYANA

Sun, who was banned for three months in 2014 for a separate doping offence, will be eligible to return in time for the Paris 2024 Games, although he will be 32 by then.

His lawyer Zhang Qihuai said the protracted legal battle "exposed the complexities involved in fighting international cases and dealing with foreign relations (in sports), the weakness and defects of the domestic system and athlete protection measures".

"Sun Yang fulfilled his responsibilities, but he has become a victim of political posturing in this international case," Zhang wrote on the Twitter-like Weibo.

Zhang, of Lanpeng Law Firm, called Sun "the pride of China" and added: "No one can understand the helplessness and hardship of athletes in his position.

Sun (C) attended Court of Arbitration for Sport hearings in 2019
Sun (C) attended Court of Arbitration for Sport hearings in 2019 AFP / jean-guy PYTHON

"I can only say forever: Sun Yang did not violate the rules and there were no violations detected in the results (from doping tests).

"Unfortunately for China and even the world, such an excellent athlete has fallen into the hands of international organisations manipulated by some people."

It was not clear which organisations Zhang was referring to.

Sun is an 11-time world champion and the 1,500m world-record holder
Sun is an 11-time world champion and the 1,500m world-record holder AFP / Martin BUREAU

There was no immediate reaction from Sun, who has been dogged by controversy throughout his career and clashed with his swimming rivals on several occasions.

He has always maintained his innocence in the murky events of September 2018 when doping inspectors visited his home and a member of his entourage smashed a vial containing a sample of his blood.

The reigning 200m freestyle Olympic champion, who is also an 11-time world champion, says the testers were not qualified or authorised.

But CAS said Tuesday that a new panel, installed after the Swiss federal decision, "found to its comfortable satisfaction" that Sun had "acted recklessly" and committed two anti-doping rule violations when an unsuccessful attempt was made to collect blood and urine samples at his home.

The World Anti-Doping Agency said it welcomed the ban.

Sun has long been feted in China, and the question, "What does the four-year ban mean for Sun Yang?" was trending on Weibo with at least 190 million views.

Many Chinese people continue to back the swimmer despite this latest stain on his reputation.

"If he's really innocent, he's very wronged," Yuan Chunfeng, a banking and finance worker, told AFP in Beijing.

"It's such a pity and I feel very sorry for him."

Those sentiments are unlikely to be shared by his rivals in Tokyo.

At the 2019 world championships, the Australian swimmer Mack Horton refused to pose for pictures with Sun on the medal podium, a protest repeated by Britain's Duncan Scott.

The enraged Sun shouted "I win, you loser" at Scott, in angry scenes rarely seen in swimming.