(CNN)For hundreds of years, dogs of all shapes and sizes -- labradors and terriers, chihuahuas and spaniels -- have held the position of man's best friend.
Now, a study published Friday in the journal Science has shown that the genetic diversity in modern dogs can be traced back to the end of the last Ice Age, linking Fido and Rex to ancient canine populations.
Researchers studied DNA extracted from bones from ancient dogs for clues to evolutionary changes that occurred thousands of years ago, and found that just after the Ice Age, there were at least five types of dog with distinct genetic ancestries. They found that dog lineages have "mixed and combined," and are still present in the dogs of today.
"Already by 11,000 years ago -- before agriculture, and before any other animal had been domesticated -- dogs had not only been domesticated, but they had already diversified genetically and likely spread across large parts of the world," Anders Bergstrom, lead author and post-doctoral researcher in the Ancient Genomics Laboratory at London's Francis Crick Institute, told CNN.
The team of researchers, comprising scientists at the Francis Crick Institute, the University of Oxford and the University of Vienna and archaeologists from more than 10 countries, found that that while these early lineages have changed and mixed over the past 11,000 years, they are still represented in dog populations around the world.
Chihuahuas have an ancient lineage
Rhodesian ridgebacks, while mostly European in ancestry, contain some DNA from an ancient Middle Eastern or African lineage, Bergstrom said, while some dogs in Siberia and the Arctic, such Siberian huskies, get much of their DNA from an ancient Siberian lineage.
Meanwhile, dog breeds from Mexico -- such as chihuahuas and Mexican hairless dogs -- are largely European in their lineage but retain some pre-Columbian DNA.
"All dog breeds from Europe share a common history that started with an ancient mixture, many thousands of years ago, between two very distinct dog lineages -- one related to dogs in the Near East, and the other related to dogs in Siberia. This ancient mixing event between these two lineages gave rise to the European dog gene pool which later would give rise to all present-day European dog breeds," Bergstrom said.