Cats have been part of human society for nearly 10,000 years, but they weren’t always string-chasers and lap-sitters. Ancient felines hunted crop-destroying rats and mice for early farmers, and in return we provided food and protection. At least that’s what scientists have long speculated. Now, they can back it up. Cat bones unearthed in a 5000-year-old Chinese farming village indicate that the animals consumed rodents and that some may have been cared for by humans. The findings provide the earliest hard evidence of this mutually beneficial relationship between man and cat.

The book of cat domestication is missing a few pages. The oldest record of cats entering human society comes from an early farming village known as Shillourokambos, located on the southern coast of the Mediterranean island of Cyprus. In 2001, researchers led by Jean-Denis Vigne, now director of research at the French National Centre for Scientific Research in Paris, discovered the shared grave of a human and feline underneath an ancient home. The skeleton of the animal—dated to 9500 years ago—was surrounded by carved seashells, indicating that cats held a special status in this society. Indeed, Vigne and others have argued that felines were important to the survival of such villages, whose large surpluses of grain attracted armies of rodents; the tamest cats, meanwhile, cozied up to humans, self-domesticating themselves over the course of thousands of years. Yet, there was no solid evidence for this hypothesis, and cats largely vanished from the historical record until about 4000 years ago, when they began to appear on the tomb paintings of ancient Egypt.

The new study fills in some of that missing history. A team of archaeologists excavating an ancient settlement known as Quanhucun in central China has found eight cat bones—a pelvis, a mandible, and other pieces, all dating to about 5300 years ago—scattered among other animal bones, pottery fragments, and stone tools in garbage pits around the site. The villagers, perhaps a thousand strong, were successful millet farmers—and they clearly had a pest problem. The researchers unearthed rodent burrows tunneled into grain storage pits and v-shaped ceramic vessels the size of giant flower vases, likely designed to keep stored grain out of the mouths of scavengers. The inhabitants’ best weapon against these rodents, however, may have been cats.

When the team analyzed the bones of the felines, it discovered forms—or isotopes—of carbon and nitrogen that indicated that the cats ate small animals, which themselves had eaten grain . Based on other bones found at the site, those animals were likely rodents, the researchers report online today in the Proceedings of the National Academy of Sciences. The species of the cats is unclear. But the size and shape of the remains indicates they may belong to the genus Felis, which encompasses several species of small felines, including the Near Eastern wildcat (Felis silvestris lybica), believed to be the ancestor of today’s housecat .

While these animals were protecting crops, villagers may have returned the favor. One of the cats had an unusually high level of grain in its diet. “That’s unexpected because cats are obligate carnivores,” says team member Fiona Marshall, a zooarchaeologist at Washington University in St. Louis. “It suggests that this cat was eating human food.”

Another cat was an older individual, perhaps about 6 years old based on the wear of its teeth, Marshall says. “For a wildcat, it’s very rare to have teeth so worn, so old,” says Vigne, who was not involved in the study. “The most acceptable interpretation is that this cat was taken care of by people. I’m convinced that there was a tight connection between humans and cats at this time in China.”

“Scientists have long suspected that cats were drawn to early farming settlements because of rodents and human refuse, but there’s never been actual evidence to test this hypothesis,” Marshall says. “That’s what’s exciting about these new data. We’re finally seeing the mechanisms behind feline domestication.”

“This is a super-interesting opening chapter,” says Carlos Driscoll, whose genetic sequencing of hundreds of wild and domestic cats in 2007 pegged Felis silvestris lybica as the ancestor of today’s housecats. “But it’s just the beginning of the conversation.” For one thing, he notes that the Quanhucun cats were found in the trash, rather than buried with pomp like the Cyprus cat was. “That raises the possibility that these animals weren’t pets at all. They may have been eaten or used for their fur.”

The species also makes a big difference, says Driscoll, the WWF chair in conservation genetics at the Wildlife Institute of India in Dehradun. If the Quanhucun cats are lybica, they made it from the Near East to China thousands of years earlier than thought, possibly along ancient trade routes. But that also means that the cats were already tame, and that the Chinese farmers played little role in their domestication. It’s also possible, he says, that the Quanhucun cats were a different species of feline—perhaps jungle cats (Felis chaus) or leopard cats (Prionailurus bengalensis)—that were domesticated independently in China. Because the DNA of these creatures is different from that found in modern housecats, however, these animals either died out or were overtaken by domestic cats from the Near East.

Vigne is now working with the Chinese team to sequence the DNA of the cat bones. If the animals were wildcats, he says, it means that farming was critical to the domestication of the cat, and that this turn of events may have happened more than once. “In different places in the world, you have this same process going on. It strengthens our view of what led to this more intense relationship between humans and cats.” It also means something more fundamental: The rise of human civilization was destined to give rise to the housecat.