Hamster populations in France have been dwindling precipitously, and now researchers finally know why: the rodents are apparently going mad and devouring their offspring alive.

The thing that's driving them crazy? Apparently, it's a diet that's rich in corn. And the scary thing is, a similar diet has the potential to turn humans into demented cannibals too, reports Phys.org.

The epidemic has its roots in a condition called pellagra, which is caused by a deficiency in vitamin B3, or niacin. Symptoms in humans suffering from this debilitating disease include diarrhea, dermatitis and even dementia. People who consume diets that are heavy in corn are more susceptible to this deficiency than others.

"Improperly cooked maize-based diets have been associated with higher rates of homicide, suicide and cannibalism in humans," the researchers noted.

In dogs, niacin deficiency can cause something called "black tongue syndrome," which is actually a symptom also seen in some of the French hamsters.

The reason that hamsters are eating so much corn is because their habitat, which was once rich in a variety of grains, roots and insects for them to eat, has been replaced by the large-scale monocultural farming of maize. Corn offers plenty of calories, but not a balanced diet, and the monotonous food is leaving the animals severely malnourished and deranged.

Most disturbing of all is how this is affecting hamster behavior, turning them towards infanticide and cannibalism.

The findings were reported in the journal Proceedings of the Royal Society of London B.

Niacin is the key

To confirm that niacin deficiency was to blame for the horrifying behavior, researchers fed separate groups of hamsters with different diets in the lab. About four-fifths of the pups born of mothers feasting on a balanced diet of wheat-and-clover or wheat-and-worms were weaned — a healthy percentage. But only 5 percent of the baby hamsters whose mothers ate corn survived, and most of them perished from infanticide.

Adding niacin supplements to the diets of hamsters eating corn returned their behavior back to normal; pups were no longer being eaten alive.

The findings highlight how our agricultural practices can have dire consequences for wildlife and ecosystems.

"Knowing that these species already face many threats, and that most of them are in danger of extinction, it is urgent to restore a diverse range of plants in agriculture schemes," the researchers urged.