This illustration shows the giant ground sloth Mylodon feeding on the carcass of the hoofed native herbivore Macrauchenia. These extinct mammals roamed Patagonia and other parts of South America 12,000 years ago.

Sign up for CNN’s Wonder Theory science newsletter. Explore the universe with news on fascinating discoveries, scientific advancements and more.

CNN  — 

Modern sloths hang out in trees, move at a slow pace and eat a vegetarian diet – but the same thing can’t be said for their extinct relative, Mylodon.

This ancient ground sloth, which lived in South America until about 10,000 years ago, chowed down on meat as well as plants, making it an omnivore. The finding, rooted in new research, contradicts previous scientific understanding of the giant extinct creatures.

“Whether they were sporadic scavengers or opportunistic consumers of animal protein can’t be determined from our research, but we now have strong evidence contradicting the long-standing presumption that all sloths were obligate herbivores,” said lead study author Julia Tejada, American Museum of Natural History research associate and postdoctoral researcher at the University of Montpellier, France, in a statement.

There are only six sloth species alive today, and all of them can be found living in the trees of tropical rainforests in Central and South America. But ancient ground sloths were another story. Some of them reached the size of elephants and lived in a broad range of habitats, from Alaska to the tip of South America.

The sloth in the study, known as Darwin’s ground sloth, or Mylodon darwinii, likely reached 10 feet (3 meters) in length and weighed between 2,220 and 4,400 pounds (1,007 and 1,996 kilograms). Analysis of the jaws and teeth preserved as fossils from ancient sloths, as well as fossilized poop, have always suggested Mylodon and other extinct ground sloths ate plants like their modern counterparts.

However, these clues don’t reveal the entire story of what an animal ate during its lifetime, especially if that animal was scavenging.

New evidence from chemical detective work

The researchers conducted a chemical analysis of amino acids, the building blocks of proteins, that were preserved in the hair from Mylodon specimens. When an animal eats specific foods, nitrogen isotopes are trapped inside amino acids, which then leave a trace inside body tissue, like hair or nails, and collagen, which can be found in bones and teeth.

The nitrogen isotope signals can show if an animal was an herbivore, carnivore or omnivore.

In this case, the analysis revealed the giant ground sloth ate meat as well as plants. The researchers refer to the sloth as an “opportunistic omnivore,” meaning that it may have scavenged from carcasses of other animals or ingested animal protein from eggs.

In addition to studying Mylodon’s hair, the researchers analyzed samples from seven species of sloth and their close anteater relatives, both living and extinct for comparison. The team also studied a wide range of modern omnivores.

Skin and dung from Mylodon are on display at the American Museum of Natural History.

Another extinct sloth the scientists studied, a ground sloth called Nothrotheriops shastensis that once lived in North America, was determined to be an herbivore. But Mylodon stood out as a clear omnivore.

Previous research has suggested there wasn’t enough vegetation to support all of the herbivores living at the time across South America, so Mylodon may have turned to other food sources. The new study supports that hypothesis.

“These results, providing the first direct evidence of omnivory in an ancient sloth species, demands reevaluation of the entire ecological structure of ancient mammalian communities in South America, as sloths represented a major component of these ecosystems across the past 34 million years,” Tejada said.

The study published in October in the journal Scientific Reports.