Who was the first person to have a cat as a pet? Probably someone living in western Asia and Egypt about 10,000 years ago, research indicates.

Scientists analyzed the DNA of cat remains — feline bones and teeth, hair and skin — dug up from various geographic locations throughout Europe, Asia and Africa, and dating to different time periods across roughly 9,000 years, a study in the journal Nature Ecology & Evolution said, finding domestic felines can trace their genes to the African wildcats of the Near East and Egypt. Wildcats were found “all over the Old World,” but that specific subspecies in those areas is the one that has a link to today's domestic cats.

Read: Why Are This Country's Men the Tallest in the World? Ancestors Who Hunted Mammoths

The fact that ancient Egypt was involved in this transformation from wild cats to domesticated ones may not come as a surprise, considering the well-known relationship between humans and cats in that civilization: Ancient Egyptians held cats in high regard and even worshiped a goddess who was part cat.

“Both Near Eastern and Egyptian cat lineages contributed at different times to the maternal genetic pool of domestic cats, with one or other present in the vast majority of present-day cat breeds,” the researchers said. “While the cat’s worldwide conquest began during the Neolithic period in the Near East,” the study said, referring to a time period also known as the New Stone Age that started about 12,000 years ago, “its dispersal gained momentum ... when the Egyptian cat successfully spread throughout the Old World.”

The Neolithic period was marked by a movement from hunting and gathering to a more settled lifestyle, with prehistoric humans raising crops, domesticating animals for livestock and building communities instead of wandering from place to place.

cat-bones2 The bones of a cat buried in a 6,000-year-old grave in Hierakonpolis, Egypt. Photo: Hierakonpolis Expedition/KU Leuven

Ancient peoples used a cat “as a pest-control agent, object of symbolic value and companion animal,” the study said. The way the domesticated cats seem to have spread to other areas suggests “dispersal along human maritime and terrestrial routes of trade and connectivity.”

But even though cats have been human companions for thousands of years, more selective breeding came later. The study indicated “a coat-color variant was found at high frequency only after the Middle Ages” and it was likely the ancient Egyptians, for example, had only striped cats, the DNA analysis showed. And that makes sense since the civilization’s paintings depict only cats with stripes, rather than spots or blotches, the researchers said.

“It was only in the 18th century A.D. that the blotched markings were common enough to be associated with the domestic cat ... and physical traits started to be selected only in the 19th century A.D. for the production of fancy breeds,” the study said. “Thus, both our data and recent genomic data suggest that cat domestication in its early stages may have affected mainly some behavioral features, and distinctive physical and aesthetic traits may have been selected for only recently.”

Read: These Ancient Human Sacrifices Were POWs Kept As Slaves

One thing that remains to be uncovered is if the Egyptians' domesticated cats on their own or used the animals that other people began to domesticate in the neighboring region of the Near East.

“It’s still unclear ... whether the Egyptian domestic cat descends from cats imported from the Near East or whether a separate, second domestication took place in Egypt,” researcher and paleogeneticist Claudio Ottoni said in a statement from Belgian university KU Leuven. “Further research will have to show.”

Either scenario is possible given the connection the ancient Egypt civilization had to the Near East. Recent research showed those Egyptians were related much more closely to western Asians than modern Egyptians, who get more of their DNA from African ancestors.