"I always heard voices in my head saying what a useless bastard I am, but the voice is my own," says Stephen Fry. "It is my own voice, telling me what a worthless lump of shit I am."

One of Britain's best-loved actors and comedians, Fry spent years drinking vodka and taking cocaine to numb the internal anguish of his depression. "I'm actually kind of sobbing and kind of tearing at the walls inside my own brain while my mouth is, you know, wittering away in some amusing fashion," he says.

The 49-year-old actor has been tormented by mental illness for much of his life. But he has never before spoken of it with such candour. This week for the first time, in a programme to be broadcast on BBC2, he bares his soul.

Download the new Independent Premium app Sharing the full story, not just the headlines

He was first referred to a psychiatrist at Uppingham public school, where, he says, he was "in a constant state of edginess" and " impossible to handle".

By the time he was 17, he was suicidal. "Everything that happens is because you are a cunt," he said. "That's because I'm a complete wanker, that's because I'm an arsehole, yes. You, you, you kind of almost have a Tourette's view of yourself."

In a moment of despair, he tried to kill himself. He has wrestled with demons ever since. Now he lays his illness open to public scrutiny. "I want to speak out, to fight the public stigma and to give a clearer picture of a mental illness most people know little about."

Fry had to wait until he was 37 before he was finally diagnosed with bipolar disorder, a condition characterised by soaring highs and despairing lows.

Nobody saw it coming. Before his sensational collapse became headline news he was one of television's best-loved performers. He was at the height of his fame, after years of sustained success, yet everything came to an abrupt end in 1995 after he walked out from a starring role after just three shows of the West End play Cell Mates, which had suffered poor reviews.

Fry came close to gassing himself in his car. "I had this image of my parents staring right in at me while I sat there for at least, I think, two hours in the car with my hands over the ignition key," he says. " And so I decided not to do it. When you feel you can't go on - it's, it's not just a phrase, it is a ... it's, it's a reality. I could not go on, and I would have killed myself if I didn't have the option of disappearing because it was that absolute."

He went missing in Europe for a week then returned to London and spent months having psychological treatment in the US. In the BBC2 documentary, The Secret Life of the Manic Depressive, he consults experts and fellow sufferers of bipolar disorder, including the comedian Tony Slattery and the Hollywood actors Richard Dreyfuss and Carrie Fisher.

The illness, formerly known as manic depression, affects hundreds of thousands of people in the UK. Although it can be managed successfully with drug and psychological therapies, 15 per cent of sufferers - about 2,000 people a year - kill themselves. Doctors estimate that one in 100 have bipolar disorder, but some researchers think the true figure could be far higher. Campaigners say only about half of sufferers are actually diagnosed and, on average, this can take eight years.

The delay could be costing lives, says Michelle Rowett, chief executive of MDF The BiPolar Organisation, a user-led charity. "Bipolar has the highest suicide rate out of all mental illnesses," she says. "So people not treated soon enough are having their lives put at risk."

The disorder costs the country £2bn a year and the National Institute for Clinical Excellence (Nice) recently released its first guidelines on it. Nice says at least £30m is needed to help people who are bipolar, mainly through provision of psychological therapies.

At present, most sufferers do not receive optimal care, only 5 per cent have psychological therapy and just a third of known sufferers have a yearly check of their state of mind.

Professor Nick Craddock of Cardiff University is conducting the world's largest study into bipolar disorder in an attempt to improve diagnosis and treatment. Findings being published this year will implicate several genes. "Genes can make someone susceptible but external triggers will play a big role in determining whether that person goes on to develop bipolar disorder," he says. "Several per cent of the population have a tendency to have bipolar mood swings."

Fry fears the growing intensity of his attacks of depression and says he is "in a very sort of black state" but remains undecided about whether he needs medical treatment. "I love my condition too. It's infuriating I know, but I do get a huge buzz out of the manic side. I rely on it to give my life a sense of adventure, and I think most of the good about me has developed as a result of my mood swings.

"It's tormented me all my life with the deepest of depressions while giving me the energy and creativity that perhaps has made my career."

Other voices: 'I drank because I was in love'

Amy Winehouse, 23, the singer-songwriter, recently spoke about her " addictive personality" and brief time in rehab. Amy, who this year admitted drinking too much, said she refuses to take medication, even though clinically diagnosed as a manic depressive. Of her visit to rehab, she said: "The fella in charge said: 'Why are you here?', and I said: 'Well, I think I've come here because I'm drinking a lot. But I'm in love and the drinking is symptomatic of my depression. I'm not an alcoholic.'" She left. Her new single "Rehab" is released next month.

'Stephen Fry: The Secret Life of the Manic Depressive', Tuesday, 9pm, BBC2