WOODSIDE, Calif. — Koko the gorilla who mastered sign language, raised kittens and once playfully tried on the glasses of the late actor Robin Williams, has died. She was 46.

The Gorilla Foundation says the western lowland gorilla died in her sleep at the foundation’s preserve in California’s Santa Cruz mountains on Tuesday.

Koko’s capacity for language and empathy opened the minds and hearts of millions of people.

Koko’s capacity for language and empathy opened the minds and hearts of millions of people, the foundation said. She appeared in many documentaries and twice in National Geographic. The gorilla’s 1978 cover featured a photo that the animal had taken of herself in a mirror.

Williams, another San Francisco Bay area legend, met Koko in 2001 and called it a “mind-altering experience.” The two hold hands and tickle each other in a widely shared video.

“We shared something extraordinary: laughter,” he says. “Koko understands spoken English and uses over 1,000 signs to share her feelings and thoughts about daily events. Life, love, even death.”

“It was awesome and unforgettable,” said the actor, who killed himself in August 2014.

Fans mourned Koko’s passing, and the foundation’s website experienced excessive traffic on Thursday.

“Legit bawling like a baby right now,” posted a person on the foundation’s Facebook page. “From an early age I was fascinated with Koko and she taught me so much about love, kindness, respect for animals, and our planet.”

Another person posted: “At least Koko can finally be reunited with All Ball.”

“All Ball” was the name of the first of several kittens Koko raised into cat-hood. She chose the gray-and-white kitten from a litter for her birthday in 1984, according to a 1985 Los Angeles Times article.

“The cat was a Manx and looked like a ball. Koko likes to rhyme words in sign language,” said Ron Cohn, a biologist with the foundation.

Watch an excerpt from a 2006 PBS-BBC documentary called “Koko: The Gorilla Who Talks.”

All Ball died after being hit by a car. Cohn said she was devastated by the kitten’s death.

Koko was born at the San Francisco Zoo, and Dr. Francine Patterson began teaching the gorilla sign language that became part of a Stanford University project in 1974.

In 2004, she used American Sign Language to communicate that her mouth hurt and used a pain scale of 1 to 10 to show how badly it hurt, according to an AP news story.

Koko was also part of a lawsuit when two former caretakers said they had been fired to refusing to bare their breasts to the gorilla, who apparently loved nipples. The women settled with the foundation in 2005.

Koko painted objects in her environment but also expressions of her thoughts and emotions. She used signed language to name her paintings.

The foundation says it will honor Koko’s legacy with a sign language application featuring Koko for the benefit of gorillas and children, as well as other projects.

Below, watch Koko meeting Mr. Rogers.