When theater legend Andrew Lloyd Webber was being treated for prostate cancer in 2009, there was a point where he wanted to die rather than keep on fighting.

In a new interview, the Cats creator admits he obtained paperwork to undergo legal euthanasia while suffering from debilitating pain due to a myriad of health issues.

"There were days when I thought that I would do anything to get out of this," shares the 66-year-old. "I adore my work, and I thought that if I could not do that, then I had nothing more."

andrew lloyd webber

Andrew posing with the cast from another one of his musicals, "Starlight Express"

So he obtained an official application from Swiss assisted dying clinic Dignitas. "I went through a moment of deep depression — that awful moment when you think that you must find a way out," Andrew says.

But the Oscar and Tony Award-winning composer, who was given the all-clear in 2010, is extremely thankful he never went through with it.

"With hindsight, it was stupid and ridiculous, but I couldn't think what to do," he tells The Daily Telegraph. "I got through the show I was working on, but it was murder. I was on every sort of painkiller there is…[But] in the end, I threw away the forms."