NEW YORK (AP) — Neanderthals and humans likely mixed and mingled during a narrow time frame 45,000 years ago, scientists reported Thursday.

Researchers analyzed ancient genes to pinpoint the time period, which is slightly more recent than previous estimates for the mating.

Modern humans emerged in Africa hundreds of thousands of years ago and eventually spread to Europe, Asia and beyond. Somewhere along the way, they met and mated with Neanderthals, leaving a lasting fingerprint on our genetic code.

Scientists don't know exactly when or how the two groups entangled. But ancient bone fragments and genes are helping scientists figure that out.

“Genetic data from these samples really helps us paint a picture in more and more detail,” said study co-author Priya Moorjani at the University of California Berkeley.

The research published Thursday in the journals Science and Nature.

To pin down the timeline, researchers peeked at some of the oldest human genes from the skull of a woman, called Zlatý kůň or Golden horse for a hill in the Czech Republic where it was found. They also examined bone fragments from an early human population in Ranis, Germany, about 140 miles (230 kilometers) away. They found snippets of Neanderthal DNA that placed the mating at around 45,000 years ago.

In a separate study, researchers tracked signs of Neanderthal in our genetic code over 50,000 years. They found Neanderthal genes related to immunity and metabolism that may have helped early humans survive and thrive outside of Africa.

We still carry Neanderthals' legacy in our DNA. Modern-day genetic quirks linked to skin color, hair color and even nose shape can be traced back to our extinct former neighbors. And our genetic code also contains echoes from another group of extinct human cousins called Denisovans.

Future genetic studies can help scientists detangle exactly what — and who — we're made of, said Rick Potts, director of the Smithsonian’s Human Origins program who was not involved with the new research.

“Out of many really compelling areas of scientific investigation, one of them is: well, who are we?” Potts said.

—-

The Associated Press Health and Science Department receives support from the Howard Hughes Medical Institute’s Science and Educational Media Group. The AP is solely responsible for all content.

This image provided by Max Planck Institute for Evolutionary Anthropology shows an artist’s illustration of an ancient human that scientists call Zlatý kůň, whose skull was found in the Czech Republic..(Tom Björklund/Max Planck Institute for Evolutionary Anthropology via AP)

Credit: AP

icon to expand image

Credit: AP

This image provided by National Museum, Prague shows the skull of an ancient human called Zlatý kůň, originally discovered in the Koněprusy caves of the Czech Republic. (Marek Jantač/National Museum, Prague via AP)

Credit: AP

icon to expand image

Credit: AP

This image provided by Max Planck Institute for Evolutionary Anthropology shows an artist’s illustration of ancient humans from Ranis, Germany and the Czech Republic traveling together 45,000 years ago.(Tom Björklund/Max Planck Institute for Evolutionary Anthropology via AP)

Credit: AP

icon to expand image

Credit: AP