LOS ANGELES - Oscar-winning actor Robin Williams shot to fame for his madcap standup act and his offbeat alien Mork, but his most famous roles showed a depth of pain behind the comedian's mask.
The wildly popular 63-year-old funnyman, whose career spanned more than three decades, was known for rapid-fire, stream-of-consciousness improvisations and impersonations.
On screen, his characters were often offbeat and eccentric - from the zany alien Mork from the planet Ork, the television role in the 1970s that first catapulted him to fame, to the divorced dad who transforms himself into a elderly British nanny in Mrs. Doubtfire.
His skill at imitating voices was often showcased - as in his portrayal of the genie in the 1992 Disney adaptation of "Aladdin," in which his character runs through a string of celebrity impressions.
But he also found success in darker roles, including an Oscar-winning turn as psychologist Sean Maguire, a Vietnam veteran and widower who counsels troubled genius Will Hunting.
'I was shameful'
But for all Williams Hollywood success and outsize public persona, the comedian faced private demons, including recurring battles with drugs, alcohol and mental illness.
He quit drinking and cocaine in the early 1980s, when his first son was born, but after 20 years sober, he started drinking again while filming in Alaska in 2003, he told the Guardian newspaper in 2010.
"It was that thing of working so much, and going 'F***, maybe (drinking) will help?' And it was the worst thing in the world," he told the newspaper, adding, however, he did not start taking drugs again.
It took him another three years to get back to sobriety, after a family intervention led him to rehab, he said, blaming his drinking for the breakup in 2008 of his 19-year-second marriage.
"You know, I was shameful, and you do stuff that causes disgust, and that's hard to recover from." It was health problems - and open heart surgery - in 2009 that he credits with being the true turning point.
"It breaks through your barrier, you've literally cracked the armor. And you've got no choice, it literally breaks you open. And you feel really mortal," he said.
During the three-hour surgery, doctors replaced Williams' aortic valve, repair his mitral valve, and correct an irregular heart beat.
The actor was also reportedly diagnosed with bipolar disorder, and in July, 2014, he checked into a Minnesota rehab facility for help maintaining sobriety after a grueling year-and-a-half of work.
A darker side
One of Williams' most famous roles was as radio disk jockey Adrian Cronauer, whose loud and drawn out "Gooooooood morning, Vietnaaaaaam" started each broadcast and was the title of the film.
The character bucks authority on the air, bringing US troops the 1960s rock music and lifestyle they missed from home, playing unapproved songs and riffing in quick-fire improvisations in between.
Although he brings humour to his portrayal of the character, the film, set amid one of the longest and deadliest US wars abroad, is hardly a comedy.
And even his more light-hearted films touch on deeper sadness, including slapstick "Mrs. Doubtfire," the cross-dressing character created by divorced dad Daniel Hillard in desperation to see his kids, who were living with a wife who sees him as irresponsible.
Williams was beloved as inspirational prep-school teacher John Keating, in the "Dead Poets Society," another character that defied authority with an unorthodox teaching style that ultimately gets him fired.
And in yet another dramatic role in "Awakenings," Williams played Malcolm Sayer, a doctor with a ward full of catatonic patients.
Sayer finds success with a treatment, shepherding his newly-awakened charges into an unfamiliar world decades after their mental freeze, but it is ultimately temporary.
But Williams left behind his darker side in films for children, including as the voice behind the genie in Disney's "Aladdin," singing the iconic, and award-winning, song "Friends Like Me," and in kids' romp "Jumanji" about a boardgame that comes to life.