The sudden death four years ago of Knut, the celebrity Berlin Zoo polar bear who ended up on the cover of Vanity Fair, shocked his fans around the world and posed a riddle for veterinarians anxious to keep other animals from suffering the same fate.

What killed Knut?

The answer turned out to be even more useful than scientists could have hoped for.

Researchers in Germany said Thursday they have found the cause of Knut's untimely demise — and the discovery may help raise awareness of a condition that affects humans, possibly saving lives.

The four-year-old bear died in March 2011 after suffering an apparent seizure and collapsing into his enclosure's pool in front of hundreds of visitors at the Berlin Zoo. His short life came as a surprise — polar bears can live for up to 20 years in the wild and sometimes longer in captivity.

A necropsy quickly established that Knut suffered from encephalitis, a swelling of the brain. Initially, scientists thought the inflammation had been caused by an infection, but that theory was later discounted.

"At the beginning of 2014, we had basically exhausted every option," said Alex Greenwood of the Leibniz Institute for Zoo and Wildlife Research, which led much of the initial research into Knut's death. Greenwood said his team shelved their samples, figuring it might take decades to figure out why Knut died.

Then they got a call from Harald Pruess, a neurologist at Berlin's Charite hospital and a researcher at the German Center for Neurodegenerative Diseases.

Pruess said he noticed that Knut's case showed similarities to some of his human patients who suffered from anti-NMDA receptor encephalitis. The autoimmune disease, in which the body attacks its own brain cells, was only discovered in humans eight years ago and never previously found in animals.

"It was a bit of a long shot, but after six or eight weeks we saw that it really was that," Greenwood told The Associated Press.

Had Knut's keepers known what their star attraction was suffering from, he likely could have been treated, said Greenwood.

Humans with the condition are given cortisone, a drug that suppresses the immune system until the body can recover. In most cases they are able to return to a normal life, though some suffer from memory problems and have difficulty concentrating.

Pruess, the neurologist, said Knut's case may help raise awareness of what is still a relatively unknown illness in humans. The disease, which affects at least one in 200,000 people each year and often involves sudden behavioral changes, can be detected with a simple procedure.

Greenwood said Knut's misfortune — he might have survived if he hadn't fallen into the water — was a stroke of luck for scientists.

"It's just for us incredible that the most famous bear in the world dies and it turns out to be the first description of this disease," said Greenwood. "The knowledge gained from his death should benefit both human medicine, because people will know the Knut disease and be more aware of it, and animal medicine."

Their research was published Thursday in the journal Nature Scientific Reports.