Former world 100m champion Tyson Gay tested positive for a banned steroid, the BBC has learned.

News of the American's failed test emerged last month, but the details of the substance he tested positive for have - until now - not been made public.

The BBC has obtained extracts of a letter sent to Gay by the United States Anti Doping Agency (Usada) which outlines the nature of the substance traced in a sample he gave to drug testers during the US World Championship trials in June.

The letter, dated 23 July, states: "Using the Carbon Isotope Ratio Analysis it reported that the sample had an adverse analytical finding reflecting values that are consistent with the administration of a steroid of exogenous [external] nature."

The letter goes on to say that a positive test for an "anabolic agent" of this kind would - if proven - be a violation of the World Anti-Doping Agency (Wada) code.

Tyson Gay Age: 30

Nationality: American

Personal bests: 100m - 9.69secs, 200m - 19.58 secs

Medals: Olympics: 4x100m relay - silver (2012); World Championships: 100m - gold (2007), silver (2009), 200m - gold (2007), 4x100m relay - gold (2007)

Under the Wada code, the standard ban for an athlete found guilty of taking a prohibited steroid is two years - the maximum punishment currently available.

A carbon isotope test, also known as an IRMS test, is normally used by anti-doping authorities to detect the banned steroid testosterone or closely related substances such as DHEA or androstenedione. These are known as precursors of testosterone.

Usada refused to comment on whether Gay had tested positive for a steroid.

But the agency confirmed on 27 July that the 2007 world 100m champion failed at least two tests. It is understood that in addition to the positive sample he gave at the US trials, he failed an out-of-competition test in May.

After being informed of his first failed test, the 30-year-old athlete pulled out of the American team selected for the World Athletics Championships, which were held in Moscow earlier this month.

World's fastest ever 100m men Usain Bolt (Jam) - 9.58 secs

Tyson Gay (USA) - 9.69 secs

Yohan Blake (Jam) - 9.69 secs

Asafa Powell (Jam) - 9.72 secs

Gay has since been given a provisional suspension by Usada while the investigation into his case continues. He will face a disciplinary hearing in the coming weeks but has already earned credit from Usada for going public with his failed tests.

The fastest man over 100m in 2013, he had been expected to challenge Usain Bolt for gold in Moscow. After withdrawing from the US squad, Gay blamed a member of his back-up team for the failed tests.

"I don't have a sabotage story," he said last month. "I basically put my trust in someone and was let down. I know exactly what went on, but I can't discuss it right now."

There have been reports in the United States linking Gay to an Atlanta-based anti-ageing doctor called Clayton Gibson. Some anti-ageing specialists are known to use hormones such as testosterone and DHEA. Gibson has confirmed working with Gay, but has been quoted saying his clinic does not give its clients "synthetic" substances.

It is thought Gay, who worked closely with Usada on anti-doping campaigns in the past and volunteered for extra testing, is co-operating with the agency to try to reduce his sentence in return for evidence and information on others who may be involved in a wider doping ring.

Although Usada would not talk about the specifics of Gay's case, chief executive Travis Tygart told the BBC: "We appreciate Mr Gay taking responsibility for his decisions and for voluntarily removing himself from the World Championships."