The appendix may not be useless after all. The worm-shaped structure found near the junction of the small and large intestines evolved 32 times among mammals, according to a new study. The finding adds weight to the idea that the appendix helps protect our beneficial gut bacteria when a serious infection strikes.

Charles Darwin was one of the first scientists to theorize on the function of the appendix, which in his day had been identified only in humans and other great apes. He hypothesized that the distant ancestors of these animals survived on a diet of leaves, and so they required a large cecum, a portion of the gut that houses bacteria that can break down stubborn plant tissue. Later, he speculated, these ancestors shifted to a largely fruit-based diet that was easier to digest. A large cecum was no longer necessary, and it began to shrink; today our cecum is tiny. Darwin thought the appendix, which juts off of the cecum, is one of its former folds that shriveled up as the cecum shrank. Consequently, he thought it carried no function.

But some scientists have challenged the idea that the appendix serves no purpose. It's been clear for about a century that the structure contains a particular type of tissue belonging to the lymphatic system. This system carries the white blood cells that help fight infections. Within the last decade, research has shown that this lymphatic tissue encourages the growth of some kinds of beneficial gut bacteria. What's more, careful anatomical study of other mammals has revealed that species as diverse as beavers, koalas, and porcupines also have a structure jutting off of their guts in exactly the same place as our appendix—in other words, the feature is much more common among mammals than once thought.

Now, an international team of researchers that includes Heather F. Smith, an evolutionary biologist at Midwestern University in Glendale, Arizona, and William Parker, a surgeon who studies the immune system at Duke University Medical Center in Durham, North Carolina, says it has the strongest evidence yet that the appendix serves a purpose. In a new study, published online this month in Comptes Rendus Palevol, the researchers compiled information on the diets of 361 living mammals, including 50 species now considered to have an appendix, and plotted the data on a mammalian evolutionary tree. They found that the 50 species are scattered so widely across the tree that the structure must have evolved independently at least 32 times, and perhaps as many as 38 times.

By plotting the dietary information onto the evolutionary tree, the researchers could work out whether the appendix appears when a particular group of mammals changes its diet. In most cases, there was no sign of a dietary shift, suggesting appendix evolution doesn't necessarily proceed as Darwin thought. He may have correctly identified the origin of the ape appendix, though, which the analysis confirms did appear when our ancestors switched diets.

Randolph Nesse, an evolutionary biologist at the University of Michigan, Ann Arbor, is impressed by the new study. "I salute the authors for creating an extraordinary database," he says. "The conclusion that the appendix has appeared 32 times is amazing. I do find their argument for the positive correlation of appendix and cecum sizes to be a convincing refutation of Darwin's hypothesis."

"I agree with the general assertion that the appendix evolved numerous times in mammals, but I think the exact count is still up for debate," adds Olaf Bininda-Emonds, an evolutionary biologist at the University of Oldenburg in Germany. There is some uncertainty over whether all 50 species considered to have an appendix really do possess one. When just the clear-cut cases are included, the appendix evolved 18 times, he says.

Even that figure suggests the appendix performs a useful function, and the hunt is now on to identify what that function is. The research team may already have the answer. In 2007, Parker and his colleagues suggested that the appendix has an immunological role, acting as a "safe house" for beneficial gut bacteria. These bacteria help train the immune system and can prevent diseases by outcompeting dangerous pathogenic bacteria—but there are times when the dangerous microbes gain the upper hand and overrun the gut. The researchers reasoned that when this happens, the beneficial bacteria could retreat to the safety of the appendix, which remains unaffected. Once the immune system has beaten the infection, the beneficial bacteria emerge from the appendix to quickly recolonize the gut.

The "safe house" idea makes sense, says Indi Trehan, a pediatrician at the Institute for Public Health at Washington University in St. Louis who recently studied the importance of maintaining gut bacteria when treating people with malnutrition. "The appendix has a unique anatomical location that is out of the way," he says. "Bacteria can be kept safe there for repopulation as needed."

The safe house hypothesis is reasonable, Nesse agrees, but he points out that just 50 of the 361 mammalian species included in the analysis have an appendix. "One wonders why such a trait with such a function would not be universal," he says. That suggests it is possible we still haven't completely cracked the mystery of the appendix, he says.