A new analysis of panda poop has finally answered an age-old question: How do giant pandas survive on a diet that's 99 percent bamboo when they have the guts of carnivores?

Plant-eating animals tend to have longer intestines to aid in digesting fibrous material, a trait the black-and-white bears lack.

What's more, when the giant panda's genome was sequenced in 2009, scientists found that the creature lacks the genes for any known enzymes that would help break down cellulose, the plant fibers found in bamboo and other grasses.

This led researchers to speculate that panda intestines must have cellulose-munching bacteria that play a role in digestion. But previous attempts to find such bacteria in panda guts had failed.

The new study looked at gene sequences in the droppings from seven wild and eight captive giant pandas—a much bigger sample than what was used in previous panda-poop studies, said study leader Fuwen Wei, of the Chinese Academy of Science's Institute of Zoology in Beijing.

Wei and colleagues found that pandas' digestive tracts do in fact contain bacteria similar to those in the intestines of herbivores.

Thirteen of the bacteria species that the team identified are from a family known to break down cellulose, but seven of those species are unique to pandas.

"We think this may be caused by different diet, the unique inner habitat of the gut, or the unique phylogenetic position of their host," since pandas are on a different branch of the tree of life than most herbivores, Wei said.

Humans Drove Pandas to Bamboo?

Even with help from gut bugs, pandas don't derive much nutrition from bamboo—a panda digests just 17 percent of the 20 to 30 pounds (9 to 14 kilograms) of dry food it eats each day. This explains why pandas also evolved a sluggish, energy-conserving lifestyle.

So how and why did pandas became plant-eaters in the first place?

Some scientists theorize that, as the ancient human population increased, pandas were pushed into higher altitudes. The animals then adopted a bamboo diet so they wouldn't compete for prey with other meat-eaters, such as Asiatic black bears, in their new homes, said Nicole MacCorkle, a panda keeper at the Smithsonian's National Zoo in Washington, D.C.

Pandas will eat meat if it's offered to them, MacCorkle added, but they won't actively hunt for it.