Thousands of years ago, a wildcat first started lingering on the outskirts of a human camp, perhaps to eat the mice living in people's granaries. Now, billions of house pets and countless cat videos later, researchers have revealed the genetic roots of the special relationship between humans and cats.

A new study traces the genetic changes that make kitties snuggle up with humans and purr for treats. Many of the changes have altered the cat's motivation to seek rewards and have lessened their fear of new situations, said study co-author Wesley Warren, a geneticist at the Genome Institute at the Washington University School of Medicine in St. Louis.

Cats and humans go way back: Some studies suggest cats were first domesticated about 9,000 years ago in the Near East, while others trace cat domestication back to China around 5,000 years ago. To unravel the mysteries of cat domestication, scientists sequenced the genome of an Abyssinian cat named Cinnamon in 2007. But that analysis wasn't complete.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Warren and his colleagues did a second sequence of Cinnamon's genome, along with the genomes of several other domestic cats and two species of wildcat, and compared them with the genomes for the tiger, the dog and many other animals. [ Animal Code: Our Favorite Genomes ]

In domestic cats, genes linked to motivation and fear faced strong evolutionary pressure over history, leading the cats to be less shy and more driven by rewards, Warren said.

Dogs have many more copies of genes for smell receptors than cats do, which probably accounts for the canines' superior sense of smell. On the other hand, the genes for feline night vision and keen hearing were under strong selection — which may explain why felines are such expert hunters, Warren said.

The findings help underpin some of the biological changes associated with domestication in cats.

"The study is great, especially in defining changes in the genome that have led to domestication or, more correctly, to the adaptation of the ancestors of domestic cats that allowed them to associate with humans and thus gain both protection from their predators and an ample food supply (rodents)," Niels Pedersen, a veterinary researcher at the University of California at Davisy, said in an email.

The findings were published Monday in the Proceedings of the National Academy of Sciences.

— Tia Ghose, LiveScience

This is a condensed version of a report from LiveScience. Read the full report. Follow Tia Ghose on Twitter and Google+. Follow LiveScience onTwitter, Facebook and Google+.