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.