The second interbreeding episode between modern humans and Neanderthals led to the introduction of DNA segments of Neanderthals into the genomes of modern humans, but most sequences were rapidly removed by purifying selection. However, for retained sequences it was not known whether this was due to positive selection and, if so, what selective advantage there was. Ednard and Petrov now show that long, frequent Neanderthal DNA segments in the genomes of modern humans are enriched for virus-interacting proteins (VIPs). In particular, VIPs that specifically interact with RNA viruses are enriched in modern Europeans. Thus, these segments might have been positively selected in response to viruses to provide an adaptive function. In agreement with this, many of the retained Neanderthal-derived VIPs had functions that are important for the virus life cycle. The retained Neanderthal DNA segments could provide insights into past epidemics.