There's nothing new about human frolicking with variants of its own kind, but scientists have found that doing so with cavemen has endowed some human gene pools with strong immune systems.

Sex with Neanderthals and their close relative, Denisovans, has led to a positive effect on modern human fitness, researchers at the Stanford University School of Medicine have found.

According to the study, although modern humans, Neanderthals and Denisovans have common ancestors in Africa, they spilt up about 400,000 years ago.

The cross breeding wasn't just a random event that happened, it gave something useful to the gene pool of the modern human, said Parham, who is senior author on the study.

During the period of cross-breeding Neanderthals were found to have introduced new variants of immune system genes called HLA class I genes, known to destroy pathogens in the human body.

The HLA gene system, with its diversity of variants, is like a magnifying glass, said lead author Laurent Abi-Rached, explaining that it provides a lot more detail about the history of populations than typical gene families.

Last year the team of researchers found that the rare variant known as HLA-B*73 came from the mingling of modern humans with archaic humans. By comparing the HLA genes of the archaic humans with modern humans, the researchers were able to show that the HLA-B*73 allele likely came from cross breeding with Denisovans. 

Although little is known about the Denisovans as the finger bone and tooth are the only fossils; by extracting a genome sequence from the finger bone they found an overlapping with modern humans.

A similar scenario is seen in some HLA gene types found in the Neanderthal genome, which was also sequenced from DNA extracted from ancient bones. We are finding frequencies in Asia and Europe that are far greater than whole genome estimates of archaic DNA in modern human genomes, which is 1 to 6 percent, said Parham. Within one class of HLA gene, the researchers estimate that Europeans owe half of their variants to interbreeding with Neanderthals and Denisovans, Asians owe up to 80 percent and Papua New Guineans, up to 95 percent.

Full results of the study have been published in the by the journal Science.