Andrew Lloyd Webber contemplated committing suicide at the height of his depression.

The 69-year-old composer has opened up about his struggles in his new memoir 'Unmasked', revealing he considered taking his own life more than once as he battled with a number of health issues, including prostate cancer in 2009 and severe back pain.

He wrote: ''It was absolute agony and utterly despairing. I did think of suicide. It was so painful. I couldn't sleep and you go on thinking about it.

''You have all those ridiculous painkillers and none of them working and you just think, 'I shall take the whole lot of them.'''

Lloyd Webber also admitted to experiencing lots of self-doubt during his younger years, which led to him developing depression.

The theatre pioneer shared: ''I got quite depressed; it's something that possibly affects artists.

''It was one of those moments where I thought everything had got on top of me. These things are illogical.''

Lloyd Webber recalled one particular incident from his youth when he stole painkiller tablets from his parents' bathroom, then bought aspirin from two different chemists, and headed off for what he presumed would be his last-ever journey on the London Underground.

The British star admitted he felt very isolated at the time, but also that he couldn't bring himself to follow through on his intention.

He confessed: ''I felt very alone at the time. It was pretty much at the end of the line, quite literally because I went to the end of the Central Line, but then took a bus to Lavenham.''

More recently, Lloyd Webber said that his third wife Madeleine Gurdon - who he's been married to since 1991 - has helped him to escape the suicidal thoughts.