Human papillomavirus — also known as HPV — can be a sly little invader.

When it infects us, the tiny, pollen-shaped virus burrows into the skin and mucous membranes and can cause genital warts and cancer. For many, the infection clears up on its own. But in the cases where it persists, the virus can live in the body for years, silently spread to other people through unprotected sex, and cause cancer in the cervix, throat, or anus.

New evidence suggests Neanderthals or Denisovans (another extinct near-human species) may be to blame for introducing a variant of this disease — specifically a cancer-causing strain called HPV 16 — to humans.

Recent evidence in genetics have found that humans had sex with Neanderthals and Denisovans many times in our history. “In those times, there was no safe sex, everything was transmitted,” Ville Pimenoff, a genetics researcher at the Catalan Institute of Oncoloy in Spain says.

Yes, Neanderthals may have given us their genital warts, Pimenoff and colleagues conclude in a new paper in journal Molecular Biology and Evolution. Gee, thanks.

The evidence here is inferred: There are no actual samples of HPV on human and Neanderthal fossils to compare. (HPV does not infect bones.) Instead, the trio of scientists used DNA and math.

DNA contains the instructions for life, but it is also a historical volume. Whether it’s in humans or in viruses, all gene pools regularly accumulate mutations in a predictable manner. By analyzing strains of HPV around the globe and the “texts” encoded in the DNA, they can work backward to trace the virus’s evolution. “We can estimate how much time evolution would have needed to create the [current] genetic diversity,” he says.

Once there’s a timeline for the evolution of HPV, we can compare it to the timeline of what’s known about human evolution. And the two stories match up.

Here’s the story, as explained by the DNA evidence: The Neanderthal (or Denisovans) ancestors left Africa long before humans did — perhaps hundreds of thousands of years earlier. When they left Africa, both the Neanderthal ancestors and our human ancestors had been exposed to a similar HPV virus ancestor.

As they separated, the Neanderthals and Denisovans developed the ancestor of what’s known as HPV 16 a. And when humans ventured out of Africa around 60,000 years ago, they encountered Neanderthals and their HPV. They had sex, and then acquired the HPV 16 a.

Understanding this helps explain the mystery of why there are so many versions of HPV 16 spread out unevenly across the globe, Pimenoff says. HPV 16 a is mainly found in Europe and Asia, while HPV 16 b and c are more concentrated in Africa. “You can’t explain this, without a host-switch event [i.e. interspecies sex],” he says.

Why does this matter?

Well, for the sake of public health today, it may not. The vaccines we now have to protect against HPV are effective regardless of the fact that the most dangerous strains of the virus came from extinct near-human relatives.

But it does tell us a lot more about human history, and can give us insight on how exposure to disease has shaped human evolution. STDs have been around since the dawn of humanity. Herpes may have first infected our ancestors more than a million years ago. Syphilis has been around since at least the Middle Ages. It’s possible STDs are what encouraged humans to stick to monogamous pairings.

“The real big picture is that our history, our evolutionary history is a lot more complex than we thought 5 to 10 years ago,” Pimenoff says. The fact that we interbred with other species can explain how humans acquired new genes after leaving Africa. But it’s important to know that viruses can drive our evolution as well. “And our history, is also the history of our pathogens.”

Pimenoff hopes to continue to study this to answer another big answer about HPV: Why does it clear up in some people very quickly, and linger and cause cancer in others? “We don’t know why in some people, the immune system naturally clears it,” Pimenoff says. Depending on your genetic background, and on the particular strain you’re exposed to “there could be a different to how your immune system reacts to an HPV infection,” he says. (The best prevention for HPV-related cancers right now, he says, are the widely available vaccines.)

Pimenoff’s study also raises questions about what happened to the Neanderthals. If we contracted HPV from them, what did they get from us? It’s possible that humans spread diseases that brought about their extinction. In April, researchers at Cambridge and Oxford Brookes universities published a paper that suggested Neanderthals may have been particularly susceptible to germs that cause stomach ulcers and herpes.

The HPV we got in return is a nuisance, but not a threat to our existence. Today, HPV is responsible for nearly all cases of cervical cancer, and can also cause cancer in the throat and anus. And HPV is everywhere. The Centers for Disease Control and Prevention finds that between 80 and 90 percent of sexually active men and women will be exposed to some form of HPV in their lives (though not all strains cause cancer). In all, HPV is thought to cause around 30,000 cases of cancer a year.

Genetics is helping us fill in the long-forgotten gaps of human history. Remember this: The humans who had sex with Neanderthals were real people. And their genital warts and cervical cancers were just as real and devastating as they can be to us today.