HEIDELBERG, Germany — Scientists have solved the zoological mystery of what killed Knut, the Berlin Zoo’s famous polar bear, more than four years after he drowned in his enclosure as horrified visitors watched.

The 4-year-old bear had an autoimmune disease that attacks the brain, according to a study published Thursday in Scientific Reports, a research journal.

It is unusual that Knut had the disease at all. Known as anti-NMDA receptor encephalitis, the disease was discovered relatively recently and was thought to affect only humans. The findings raise awareness and open up the possibilities of further veterinary research into an illness that is treatable.

The determination brings closure to a case many suspected would go cold. A team of researchers at the Leibniz Institute for Zoo and Wildlife Research in Berlin ran exhaustive tests after Knut’s death, looking for a pathogen responsible for the brain inflammation that caused a seizure just before he collapsed into his enclosure’s pool and died.