Sun Yang has had his appeal against an eight-year doping ban given by the Court of Arbitration for Sport upheld by the Swiss Federal Tribunal.
The Chinese swimmer, 29, was first cleared of wrongdoing by Fina, the swimming federation, in January 2019.
But after an appeal by the World Anti-Doping Agency (Wada) to CAS that decision was overturned.
That appeared to effectively end Sun's career but Switzerland's highest court has now set the ruling aside.
The case is once again set to be heard by the CAS but with a different panel in place.
"Wada will take steps to present its case robustly again when the matter returns to the CAS Panel, which will be chaired by a different president," Wada said in a statement.
Three-time Olympic champion Sun missed a doping test in September 2018 and was given an eight-year ban because it was his second offence.
He had served a three-month suspension in 2014 for taking prohibited stimulant Trimetazidine.
Sun told an appeal hearing in November 2019 that he missed a test because testers failed to prove their identity when they arrived at his home.
He also denied a vial containing his blood samples was smashed with a hammer.
As the ban has now been upheld, that nullifies the initial verdict and as Fina did not punish the swimmer he is free to train and compete at this stage.
- MOTD Top 10: Who are the greatest Premier League captains?
- Radio 1's Festive Live Lounge: The best Christmas songs performed by the biggest artists