LOS ANGELES – The first modern humans to leave Africa 80,000 years ago encountered Neanderthal settlements in the Middle East and — on at least some occasions — chose to make love instead of war, according to an international team of scientists who have pieced together the genetic code of humanity’s closest relatives.

Traces of that ancient DNA live on in most human beings today, the researchers report in today’s edition of the journal Science.

The finding, which was made by analyzing DNA from Neanderthal bones and comparing it to that of five living humans, appears to resolve a longstanding mystery about the relationship between Neanderthals and Homo sapiens, who coexisted in Europe and western Asia for more than 10,000 years until Neanderthals disappeared about 30,000 years ago.

Svante Paabo, the geneticist at the Max Planck Institute for Evolutionary Anthropology in Leipzig, Germany, who spearheaded the study, said he sees his ancestors in a new light.

“It’s not about understanding Neanderthals,” said genome biologist Ed Green, who led the study as a research fellow in Paabo’s lab and is now at the University of California at Santa Cruz. “It’s understanding us.”

lining up the Neanderthal genome with DNA from humans and chimpanzees, Green and colleagues identified small changes that are unique to humans. Some were in genes involved in energy metabolism, skeletal structure and brain development, including four that are thought to contribute to conditions such as autism, Down syndrome and schizophrenia.

The researchers constructed the Neanderthal genome from three bone fragments found in Croatia’s Vindija Cave. Using a sterile dentistry drill, the scientists removed 400 milligrams of bone powder — an amount equivalent to the size of an aspirin.

To look for evidence of gene flow between humans and Neanderthals, the researchers sequenced the DNA of five people who now live in southern Africa, western Africa, France, China and Papua New Guinea. Since they didn’t think Neanderthals’ genes had passed to humans, they expected to find the same degree of difference between the Neanderthal genome and all five people.

Instead, they discovered that the Neanderthal DNA was slightly more similar to the three people living outside of Africa. Even more surprising, the relationship was just as strong for the individuals from China and Papua New Guinea as for the person from France, who lives in the Neanderthals’ old stomping grounds.

The simplest explanation is that a small group of humans met the Neanderthals 50,000 to 80,000 years ago after they left Africa but before they had spread throughout Europe, Asia and beyond. The logical meeting place was the Middle East, which connects northeast Africa to the Eurasian continent.