Robin Williams’ tragic death at the age of 63 from an apparent suicide comes after years of battling alcohol and drug addiction and suffering from depression.

The actor, known for putting a smile on countless faces with his infectious humor, publicly and privately struggled against demons he couldn’t always control.

Last month, the Good Will Hunting star had entered rehab to “fine-tune” his sobriety after a hectic year working on six movies plus a TV series. In a statement released yesterday, his publicist acknowledged, “He has been battling severe depression of late.”

robin williams

Robin with on-screen daughter Sarah Michelle Gellar in their canceled comedy, “The Crazy Ones”

The comedian initially fought a serious cocaine addiction and alcoholism during his days on sitcom Mork & Mindy in the late ’70s and early ’80s. It wasn’t until his close friend, John Belushi, died from a drug overdose in 1982 that Robin committed to getting clean.

“Was it a wake-up call? Oh yeah, on a huge level,” he once said of John’s death at the age of 33.

Having stayed sober for the next 20 years, Robin relapsed in 2003, eventually seeking help in 2006 for alcohol addiction.

Video: Conan O’Brien Breaks News of Robin Williams’ Death to Live Studio Audience

Of his family’s reaction to the relapse, the Oscar winner has shared, “It was not an intervention so much as an ultimatum. Everyone kind of said, ‘You’ve got to do this.’ And I went, ‘Yeah, you’re right.'”

Robin described feelings of loneliness on the Alaskan set of Christopher Nolan’s Insomnia in 2002 as the reason he took up drinking again. “I was in a small town where it’s not the edge of the world, but you can see it from there…I just thought, hey, maybe drinking will help. Because I felt alone and afraid.”

Not only did substance abuse contribute to his growing depression, but two failed marriages and expensive alimony payments only made the situation worse.

robin williams

Robin with third wife Susan Schneider in 2012

After divorcing first wife Valerie Velardi in 1988 after 10 years together and second wife Marsha Garces in 2008 after 19 years, the Mrs. Doubtfire star paid an estimated $33 million to his exes.

He admitted to returning to television last year — on the short-lived series The Crazy Ones — to help afford the sizable alimony.

Though the official cause of death has yet to be determined, the Marin County Sheriff’s Office believes it was suicide due to asphyxia, or hanging. An autopsy will be carried out later today.

Robin is survived by his third wife, Susan Schneider and his three kids, Zachary, Zelda and Cody.