The domestic dog originated from wild European wolves in the Stone Age before the development of farming, when humans hunted and gathered their food, according to a genetic analysis of ancient canine remains.

Scientists have long puzzled over how domestic dogs came into existence and their efforts have centred on the grey wolf, their closest living relatives of dogs, but there is conflicting evidence on when and where wild wolves were first tamed.

Earlier studies suggested that wolves may have been domesticated by the first farmers about 10,000 years ago in the Middle East or Asia, possibly to guard livestock. However, the latest study has found that it began much earlier in Europe, long before the development of agriculture.

Download the new Independent Premium app Sharing the full story, not just the headlines

Professor Robert Wayne of the University of California at Los Angeles said that an ancient European lineage of grey wolf, which has since gone extinct, is the most likely direct ancestor of the first domesticated dogs based on similarities in genetic sequences.

"We found that instead of recent wolves being closest to domestic dogs, ancient European wolves were directly related to them. This brings the genetic record into agreement with the archaeological record - Europe is where the oldest dogs are found," Professor Wayne said.

The study, published in the journal Science, analysed the mitochondrial DNA of ten ancient "wolf-like" animals and eight "dog-like" canines, mostly from Europe. The age of the remains ranged between 1,000 and 30,000 years old.

These DNA sequences were compared with the DNA from present-day dogs and wolves. This showed a clear relationship between modern dogs and ancient European wolves, but not between modern dogs and modern wolves, Professor Wayne said.

"None of those [modern] wolf populations seemed to be closest to domestic dogs. We thought one of them would be, because they represent wolves from the three possible centres of dog domestication, but none was. All the wolves formed their own group, and all the dogs formed another group," Professor Wayne said.

However, modern dogs were found to be closely related to the ancient wolves that had lived in Europe before they became extinct. The scientists reckoned that the domestication must have occurred about 20,000 or 30,000 years ago.

"If domestication occurred in association with hunter-gatherers, one can imagine wolves first taking advantage of the carcasses that humans left behind - a natural role for any large carnivore - and then over time moving more closely into the human niche through a co-evolutionary process," Professor Wayne said.

Previous studies showing a link between domestic dogs and wolves living in the Middle East may have been confused by interbreeding between ancient domesticated dogs and wild wolves living in that region, he said. "It does not necessarily suggest an origin in the Middle East," he added.

"This alternative hypothesis, in retrospect, is one that we should have considered more closely. As hunter-gatherers moved around the globe, their dogs trailing behind probably interbred with wolves," Professor Wayne said.

Further genetic studies based on the DNA of the chromosomes rather than the mitochondria, could finally confirm the European origin of the domestic dog, he added.