As recently as 2010, it was considered scientifically dubious and frankly somewhat indecent to suggest that humans might once have interbred with Neanderthals. Our primitive, ancient cousins were, well, primitive and ancient. Whatever genetic similarities they may have shared with modern humans, they did not share our beds.

Six years and several massive projects to map the Neanderthal and human genomes later, we now know that there was more than a little hanky panky going on some tens of thousands of years ago. Neanderthals and another ancient species, the Denisovans, not only interbred with modern humans, they did so frequently and successfully enough to give us roughly 1 to 2 percent of our DNA.

That prehistoric inheritance has turned out to be both a blessing and a curse, according to a pair of studies published Thursday in the American Journal of Human Genetics. Based on one of the same genome mapping projects that helped prove how we’re related to Neanderthals in the first place, the studies found that three genes from Neanderthals and Denisovans are essential to our immune system — both when it’s at its best and when it’s acting up.

In other words, if you’ve ever battled an infection, you have your distant Neanderthal relatives to thank. But if you wrestle with allergies, that’s their fault too.

Nothing is ever simple, is it?

Our Neanderthal and Denisovan legacy is something called “innate immunity,” one of the researchers, Janet Kelso of the Max Planck Institute in Germany, told NPR.

“This is our very early immune response,” she said. “When the body detects that there is some foreign substance in the body, these are the guys that react immediately and it kind of calls in the big guns” to fight off the virus, bacteria or other pathogen.

To Kelso, it makes a lot of sense that these are the genes that would linger in humans, long after our Neanderthal relatives died out. By the time modern humans migrated out of Africa roughly two hundred thousand years ago, the Neanderthals and Denisovans had already been hanging out in Europe and Asia for millennia. They knew the lay of the land, and even better, they knew the germs.

Though relatively few humans are thought to have mated with Neanderthals, the offspring of those who did would have benefited from the other species’ long-honed immunity to European pathogens.

“You’re able to take from a population that’s well-adapted in their immunity,” Kelso told the science website STAT.

Since the superior immune system was an evolutionary advantage, those traits would have spread quickly throughout the modern human population. (The unlucky humans whose ancestors didn’t interbreed with other species were more likely to die from disease). But the same cruel logic of evolution also meant that the big brained, better adapted humans, armed with the immunity they inherited, ultimately drove to extinction the species whose DNA they once found so helpful.

But even long-dead species can exact revenge. In this case, in the form of hay fever and cat allergies.

Victory is a fickle thing.

As Kelso explained it, the innate immunity that helped us withstand Europe’s foreign germs also made our bodies more likely to overreact to things that are totally benign.

“What you have is — you have an increased reactivity to potential pathogens, but you also have, as a kind of consequence of that, an increased reactivity to things that are not pathogenic, things like pollen and pet hair,” she told NPR.

“We see it as a trade-off,” she elaborated in STAT.

Uh huh. The Neanderthals probably feel that way too.