The foundation said the actor and Koko the gorilla shared a special bond.
The two met for a video shoot in 2001.
Koko's handlers say that at the time of the shoot she hadn't smiled in six months because her lifelong partner had passed away.
Then, when Robin Williams arrived, he made her smile. The two joked, wrestled, and even got into a tickling fight.
The foundation said Koko was somber Tuesday after her handlers explained to her she lost such a good friend.
The Gorilla Foundation posted two photos showing Koko responding to the news and then looking somber after.
Williams was found dead on Monday in a bedroom of his Marin County home from an apparent suicide.