SAN FRANCISCO (AP) — He was the funniest guy in the room, something that made it all the harder for friends and fans to accept that beneath that reservoir of frenetic energy and seemingly endless good humor resided demons so dark they could push Robin Williams to suicide.


It was no secret that the Oscar-winning actor had suffered for years from periodic bouts of substance abuse and depression — he made reference to it himself in his comedy routines. But word that he had killed himself Monday at his San Francisco Bay Area home left both friends in the Hollywood community and neighbors in the quiet neighborhood of Tiburon that he called home equally stunned and grief-stricken.


“It was so sudden and he was such a great guy and it’s such a loss to the whole community,” said Daniel Jennings who lived across the street from Williams in the quiet neighborhood where the actor was often seen riding his bike and stopping to talk to neighbors. One thing he never did, residents said, was act like a celebrity.


“He was really nice to all the neighbors,” Daniels said. “Really appreciated his kindness.”


He was last seen alive at home about 10 p.m. Sunday, according to the Marin County coroner’s office. Shortly before noon, the Sheriff’s Department received an emergency call from the home, where the star of “Good Will Hunting,” ‘’Mrs. Doubtfire,” ‘’Good Morning, Vietnam” and dozens of other films was pronounced dead.


Sheriff’s officials said a preliminary investigation determined the cause of death was suicide due to asphyxia. Williams was 63.


“This morning, I lost my husband and my best friend, while the world lost one of its most beloved artists and beautiful human beings. I am utterly heartbroken,” said Williams’ wife, Susan Schneider. “On behalf of Robin’s family, we are asking for privacy during our time of profound grief. As he is remembered, it is our hope the focus will not be on Robin’s death, but on the countless moments of joy and laughter he gave to millions.”


Williams had been battling severe depression recently, said Mara Buxbaum, his press representative. Just last month, he announced he was returning to a 12-step treatment program he said he needed after 18 months of nonstop work. He had sought treatment in 2006 after a relapse following 20 years of sobriety.


Williams joked about that fall off the wagon during a comedy tour, saying, “I went to rehab in wine country to keep my options open.”


Likewise, when word spread about his struggles with drugs in the early 1980s, Williams responded with a joke that for a time became a catchphrase for his generation’s recreational drug use: “Cocaine is God’s way of telling you you are making too much money.”


His struggles never seemed to affect his talent.


From his breakthrough in the late 1970s as the alien in the hit TV show “Mork & Mindy,” through his standup act and numerous hit films, the short, barrel-chested Williams ranted and shouted as if just sprung from solitary confinement. Loud, fast and manic, he parodied everyone from John Wayne to Keith Richards, impersonating a Russian immigrant as easily as a pack of Nazi attack dogs.


He was a riot in drag in “Mrs. Doubtfire,” or as a cartoon genie in “Aladdin.”


He could do drama, too, winning his Academy Award as an empathetic therapist in the 1997 film “Good Will Hunting.”


He won Golden Globes for “Good Morning, Vietnam,” ‘’Mrs. Doubtfire” and “The Fisher King.”


Other film credits included Robert Altman’s “Popeye” (a box office bomb), Paul Mazursky’s “Moscow on the Hudson,” Steven Spielberg’s “Hook” and Woody Allen’s “Deconstructing Harry.”


“Robin was a lightning storm of comic genius and our laughter was the thunder that sustained him. He was a pal and I can’t believe he’s gone,” Spielberg said.


More recently, he appeared in the “Night at the Museum” movies, playing President Theodore Roosevelt in the comedies in which Ben Stiller’s security guard has to contend with wax figures that come alive and wreak havoc after a museum closes. The third film in the series is in post-production, according to the Internet Movie Database.


In April, Fox 2000 said it was developing a sequel to “Mrs. Doubtfire” and Williams was in talks to join the production.


Williams also made a short-lived return to TV last fall in CBS’ “The Crazy Ones,” a sitcom about a father-daughter ad agency team that co-starred Sarah Michelle Gellar. It was canceled after one season.


As word of his death spread, tributes from inside and outside the entertainment industry poured in.


“Robin Williams was an airman, a doctor, a genie, a nanny, a president, a professor, a bangarang Peter Pan, and everything in between. But he was one of a kind. He arrived in our lives as an alien - but he ended up touching every element of the human spirit. He made us laugh. He made us cry. He gave his immeasurable talent freely and generously to those who needed it most - from our troops stationed abroad to the marginalized on our own streets,” President Barack Obama said in a statement.


Born in Chicago in 1951, Williams would remember himself as a shy kid who got some early laughs from his mother — by mimicking his grandmother. He opened up more in high school when he joined the drama club, and he was accepted into the Juilliard Academy, where he had several classes in which he and Christopher Reeve were the only students and John Houseman was the teacher.


Encouraged by Houseman to pursue comedy, Williams identified with the wildest and angriest of performers: Jonathan Winters, Lenny Bruce, Richard Pryor, George Carlin. Their acts were not warm and lovable. They were just being themselves.


“You look at the world and see how scary it can be sometimes and still try to deal with the fear,” he said in 1989. “Comedy can deal with the fear and still not paralyze you or tell you that it’s going away. You say, OK, you got certain choices here, you can laugh at them and then once you’ve laughed at them and you have expunged the demon, now you can deal with them. That’s what I do when I do my act.”


He unveiled Mork, the alien from the planet Ork, in an appearance on “Happy Days” and was granted his own series, which ran from 1978 to 1982 and co-starred Pam Dawber as a woman who takes in the interplanetary visitor.


“I am completely and totally devastated,” Dawber said in a statement. “What more can be said?”


Williams could handle a script, when he felt like it, and also think on his feet. He ad-libbed in many of his films and was just as quick in person. During a media tour for “Awakenings,” when director Penny Marshall mistakenly described the film as being set in a “menstrual hospital,” instead of “mental hospital,” Williams quickly stepped in and joked, “It’s a period piece.”


Winner of a Grammy in 2003 for best spoken comedy album, “Robin Williams — Live 2002,” he once likened his act to the daily jogs he took across the Golden Gate Bridge. There were times he would look over the edge, one side of him pulling back in fear, the other insisting he could fly.


“You have an internal critic, an internal drive that says, ‘OK, you can do more.’ Maybe that’s what keeps you going,” Williams said. “Maybe that’s a demon. ... Some people say, ‘It’s a muse.’ No, it’s not a muse! It’s a demon! DO IT YOU BASTARD!! HAHAHAHAHAHAHA!!! THE LITTLE DEMON!!”


In addition to his wife, Williams is survived by his three children: daughter Zelda, 25; and sons Zachary, 31, and Cody, 22.


___


Italie reported from New York. AP Entertainment writers Lynn Elber Derrik J. Lang and Associated Press Writer John Rogers contributed to this report.