Australian swimming legend Ian Thorpe reveals he is gay in an interview set to be broadcast Sunday, according to media reports, after years of denying rumours about his sexuality.

The five-time Olympic gold medallist makes the revelation in an interview with British presenter Michael Parkinson due to be aired Sunday night by Australia's Channel Ten, reports said.

Australia's Sunday Telegraph newspaper said the 31-year-old also describes his years of depression in the emotional interview recorded last month.

His decision to come out as gay attracted a flurry of supportive comments on social media.

"Brilliant Ian Thorpe now confident enough to confirm he's gay," wrote Stephen Spencer on Twitter. "Tragic that for so long he felt he had to deny this."

The swimmer known as the "Thorpedo" retired in 2006 after a glittering career in which he ruled the pool from 1998 to 2004, taking nine Olympic medals and 11 world titles and setting 13 long course world records.

He returned to racing in 2011 but had a string of disappointing results leading up to his ultimately unsuccessful London Olympic bid the following year.

Since calling it quits for a second time in 2013, Thorpe has endured several health setbacks.

In February he began treatment for depression after a mixture of painkillers and anti-depressants left him disoriented on a Sydney street.

He was hospitalised for more than three weeks in April after battling serious infections for shoulder surgery. At one point there were rumours he would lose the use of his left arm, although they proved unfounded.

Previously, Thorpe strongly denied rumours of his homosexuality.

In his 2012 autobiography "This Is Me", the swimmer wrote: "For the record, I am not gay and all my sexual experiences have been straight. I'm attracted to women, I love children and aspire to have a family one day."

He added: "I know what it's like to grow up and be told what your sexuality is, then realising that it's not the full reality. I was accused of being gay before I knew who I was."