Chinese Olympic swimmer Chen Xinyi has tested positive for a banned substance, the country's first doping scandal at the Rio Olympics.

The 18-year-old swimming prodigy, who was milliseconds from a podium finish in the 100m breaststroke final, reportedly failed a blood test taken before the Games.

The Chinese Swimming Association (CSA) confirmed Chen had tested positive for hydrochlorothiazide, a banned substance often used to mask performance-enhancing drugs.

Chen has reportedly supplied her 'B' sample for additional testing, and requested a hearing with the International Olympic Committee to look into the matter.

Chinese Olympic swimmer Chen Xinyi has allegedly tested positive to drugs

The shocking allegations were first made by Estadao, a Brazilian newspaper, who claimed that Chen was not aware of the alleged failed blood test until Tuesday.

According to Chinese news agency Xinhua, the CSA said they had 'taken the matter seriously' and 'demanded full cooperation from Chen in the investigation.'

'The CSA resolutely opposes use of banned substances. We will cooperate with the Court of Arbitration of Sport during its investigation and will respect the final ruling,' CSA said in a statement.

Chen was set to enter the pool again on Friday morning in Rio for the heats of the women's 50m freestyle, racing against Australian medal hopefuls Cate and Bronte Campbell.

She was also the likely butterflyer for China's 4x100m medley relay.

Chen's teammate Wang declined to comment after he won bronze in Thursday's 200-meter individual medley.

'This situation, I don't know the details. I'm not aware of it, so unfortunately I can't answer your question,' Wang said.

A spokesperson for FINA, the international governing body of swimming, declined to comment.