NEW YORK — For years, scientists have been dogged by this evolution question: Just where did man’s best friend first appear?

The earliest known doglike fossils come from Europe. But DNA studies have pointed to east Asia and the Middle East.

Now a large DNA study is lining up with the fossils, suggesting dogs originated in Europe some 19,000 to 32,000 years ago. Experts praised the new work but said it won’t end the debate.

Scientists generally agree that dogs emerged from wolves to become the first domesticated animal. Their wolf ancestors began to associate with people, maybe drawn by food in garbage dumps and carcasses left by human hunters. In the process they became tamer, and scientists believe people found them useful for things like hunting and guard duty. Over a very long time in this human environment, wolves gradually turned into the first dogs.

The latest attempt to figure out where this happened was published online Thursday by the journal Science.

Researchers gathered DNA from fossils of 18 ancient wolflike and doglike creatures that lived up to 36,000 years ago in Argentina, Belgium, Germany, Russia, Switzerland and the United States. They compared the genetic material to modern samples from 49 wolves from North America, Asia, Europe and the Middle East, 77 dogs of a wide variety of breeds including cocker spaniel, basenji and golden retriever, and four coyotes.

The DNA of modern dogs showed similarities to the genetic material from the ancient European specimens and modern-day European wolves, the researchers reported.

The first dogs evolved by associating with hunter-gatherers rather than farmers, since dogs evidently appeared before agriculture did, they said.

“There are now, based on genetic evidence, three alternative hypotheses for the origin of dogs,” said Robert Wayne of the University of California, Los Angeles, a study author.

He said his results suggest a better case for Europe than for east Asia or the Middle East. He also said the kind of wolf that gave rise to dogs is now extinct.

Olaf Thalmann of the University of Turku in Finland, another author, said the work doesn’t mean that Europe is the only place where dogs emerged.

“We conclude that Europe played a major role in the domestication process,” he said in an email.

The work makes a strong argument for an origin in Europe, although it might not be the only place, said Greger Larson of Durham University in England, who did not participate in the research. “I think it’s a real step in the right direction.”