Sexual relations between ancient humans and their evolutionary cousins are critical for our modern immune systems, researchers report in Science journal.
Mating with Neanderthals and another ancient group called Denisovans introduced genes that help us cope with viruses to this day, they conclude.
Previous research had indicated that prehistoric interbreeding led to up to 4% of the modern human genome.
The new work identifies stretches of DNA derived from our distant relatives.
In the human immune system, the HLA (human leucocyte antigen) family of genes plays an important role in defending against foreign invaders such as viruses.
The authors say that the origins of some HLA class 1 genes are proof that our ancient relatives interbred with Neanderthals and Denisovans for a period.