GWANGJU, South Korea (Reuters) - Shayna Jack, who withdrew from the Australia team ahead of the world swimming championships, said she had tested positive for a banned substance on Saturday.

“It is with great sadness and heartache that I had to leave due to allegations of having a prohibited substance in my system,” the 20-year-old freestyle swimmer wrote on Instagram.

“I did NOT take this substance knowingly. Swimming has been my passion since I was 10 years old and I would never intentionally take a banned substance that would disrespect my sport and jeopardize my career.

“Now there is an ongoing investigation and my team and I are doing everything we can to find out when and how this substance has come into contact with my body,” added Jack.

Team mate Cate Campbell said she had been in the dark about the positive test but added that Jack’s absence from the worlds was proof of Australia’s anti-doping commitment.

“I had absolutely no knowledge of this before tonight,” she said after her 50 meters freestyle heats.

“I think that once more information comes to light we can pass judgement but at the moment the Australia team stands for clean sport and unfortunately that is why Shayna is not with us.”

American Lilly King did not know all the details of the case but said the fact that Jack had failed a doping test meant she was a “drug cheater”.

King has been an outspoken critic of athletes who serve doping suspensions, even those on her own team. The Olympic 100 butterfly champion criticized the decision to allow Justin Gatlin on the U.S. squad for Rio 2016 over his doping record.

“Three years ago I commented on an athlete from the United States that was doping, it shouldn’t matter what country they are from even if they are from your own country,” said King.

“Doping is doping.”

Swimming Australia said it had been notified by the Australian Sports Anti-Doping Authority (ASADA) of an adverse test result following an out-of-competition test on June 26.

It then provisionally suspended Jack from the team, ruling her out of competing in Gwangju, and accompanied her back to Australia from a training camp being held in Japan.

“As you would expect we are bitterly disappointed with allegations a swimmer has a prohibited substance in her system although it is important to point out that the matter is yet to be determined,” said Swimming Australia CEO Leigh Russell.

The news will be a major embarrassment for Australian swimming given Jack’s team mate Mack Horton played a leading role in protests against Sun Yang at the world championships.

The Chinese swimmer is competing under the shadow of a World Anti-Doping Agency (WADA) appeal against governing body FINA’s decision to clear the 27-year-old of wrongdoing during the random drug test last September.

Silver medalist Horton refused to take the podium after Sun’s victory in the 400 freestyle final on Sunday.