The largest family tree of dogs ever assembled shows how canines evolved into more than 150 modern breeds.
Dogs were first selected and bred for their ability to perform tasks such as herding goats or cattle, say scientists.
Later, they were selected for physical features such as their size or colour.
The study also unearths evidence that some dogs are descended from an ancient breed that travelled with the ancestors of Native Americans into the Americas.
Archaeological evidence points to the so-called “New World dog”, which apparently crossed with human settlers over a land bridge from Asia.
It had previously been thought that all signs of this ancient breed had been erased as dogs bred in Europe spread around the world.
“We think there is still some signature of New World dog hiding in the genome of some of these American breeds,” said co-researcher Heidi Parker of the National Institutes of Health, US.
Modern hairless breeds such as the Peruvian hairless dog and the Mexican hairless dog are likely descended from this ancient dog.
In the study, Dr Parker and colleague Dr Elaine Ostrander studied the genetics of 161 modern dog breeds, and their wild relatives, the wolf and the golden jackal.
They identified 23 clusters (clades) of dog breeds that are all similar to each other.
You can now tell where different dog breeds came from – and the diseases they are prone to, they say.