A genetic study sampling the remains of more than 200 cats from sites dating over the past 9000 years shows most domestic cats descend from the Middle Eastern wildcat Felis silvestris ("cat of the woods"), and a second genetic strain from Africa.
The common domestic cat today is known as the Felis catus.
A 1983 archaeological dig on the island of Cyprus revealed a cat's jaw that dated to be around 8000 years old.
A dig in 2000 revealed a cat deliberately buried with a human and dated 1500 years earlier.
It is believed these cats must have been domesticated to be brought on the boat to the island, rather than people attempting to bring a hissing and spitting wild cat on a sea voyage.
It is thought that cats began the domestication process around 12,000 years ago, when civilisation flourished in the fertile crescent of the Middle East.
Dogs were domesticated about 3000 years earlier, being very useful to a hunter-gather society on the move.
These dogs were willing to follow humans as they moved around and to be trained by them to assist with hunting, in exchange for a share of the meat and a warm spot by the fire.
In this mobile lifestyle, cats were not of any use, but as people became more settled and agriculture developed, cats proved to be just as useful as the faithful dog.
The change from opportunistic gathering to agriculture meant storing crops, but this invited mice and rats, so cats moved in and a mutually beneficial relationship bloomed - the cats were happy to have a source of easy prey, and the humans were happy to have a pest-control system that looked after itself.
Eventually the cats moved from the storage sheds to our laps, and most still take their pest control duties seriously.
It hasn't always been easy.
The ancient Egyptians revered cats, even introducing the death penalty for someone who killed one, and cats have since been appreciated by many societies.