Image caption Some dog-looking remains are more than 30,000 years old

The results of a DNA study suggest that dogs were domesticated in Europe.

No-one doubts that "man's best friend" is an evolutionary off-shoot of the grey wolf, but scientists have long argued over the precise timing and location for their emergence.

The new research, based on a genetic analysis of ancient and modern dog and wolf samples, points to a European origin at least 18,000 years ago.

Olaf Thalmann and colleagues report the investigation in Science magazine.

It adds a further layer of complexity to the story.

Earlier DNA studies have suggested the modern pooch - in all its shapes and sizes - could track its beginnings back to wolves that attached themselves to human societies in the Middle East or perhaps in East Asia as recently as 15,000 years ago.

The problem with these claims is that palaeontologists have found fossils of distinctly dog-looking animals that are 30,000 years old or more.

Dr Thalmann, from Finland's University of Turku, and his team, have had another go at trying to sort through the conflicting DNA evidence.

They compared genetic sequences from a wide range of ancient animals - both dogs and wolves - with material taken from living canines - again, from both dogs and wolves.

This analysis reveals modern dogs to be most closely related to ancient European wolves or dogs - not to any of the wolf groups from outside Europe, nor even to modern European wolves (suggesting the link is with old European wolves that are now extinct). And because the dog remains used in the research are dated to be more than 18,000 years old, it indicates a timing for domestication that is much older than some researchers have previously argued.

If correct, it means dogs started to diverge from wolf populations when humans had yet to settle into fixed, agricultural communities and were still hunting and gathering.

Image caption The story of how dogs came to be so closely associated with humans is open to debate

It is possible there were wolves that would follow these hunters, may be at a distance at first, living off the scraps and discards from the humans' big-game kills such as mammoth, before eventually being incorporated into the human groups as they became less wary.

"You can see how wolves benefitted from living near humans because they got these carcases, but humans too would have benefitted," said Dr Thalmann.

"You have to remember that 18,800-32,000 years ago, Europe had much bigger predators than even wolves, such as bears and hyenas. And you can imagine that having wolves living close to you might be a very useful alarm system," he told BBC News. "It's a plausible scenario for the origin of the domestication of dogs."

The latest study is unlikely to be the last word on the subject, however.

Using DNA - and the subtle changes it undergoes over time - to examine animal origins and relationships is a very powerful tool, but far from fool-proof.

One of the problems scientists have is that dog populations have become very mixed over time, as a result of being moved around by their human owners. This complicates the genetic signal.

The difficulty is further amplified by the fact that some dogs have at times also clearly back-bred with wild wolves. Teasing all this apart is very difficult.

A resolution will require more sampling and more analysis, particularly of the core, or nuclear, DNA of ancient animals.

This and many of the previous studies have relied on so-called mitochondrial DNA (mtDNA), a small sub-packet of genetic material in cells that, although incredibly useful, does not represent the fullest information possible.

The larger nuclear DNA material could provide the more compelling answers but it is far harder to retrieve, especially in very old bones or fossils. A number of research groups around the world are trying, though.

Jonathan.Amos-INTERNET@bbc.co.uk and follow me on Twitter.