Bracoviruses are symbiotic viruses associated with tens of thousands of species of parasitic wasps that develop within the body of lepidopteran hosts and that collectively parasitize caterpillars of virtually every lepidopteran species. Viral particles are produced in the wasp ovaries and injected into host larvae with the wasp eggs. Once in the host body, the viral DNA circles enclosed in the particles integrate into lepidopteran host cell DNA. Here we show that bracovirus DNA sequences have been inserted repeatedly into lepidopteran genomes, indicating this viral DNA can also enter germline cells. The original mode of Horizontal Gene Transfer (HGT) unveiled here is based on the integrative properties of an endogenous virus that has evolved as a gene transfer agent within parasitic wasp genomes for ≈100 million years. Among the bracovirus genes thus transferred, a phylogenetic analysis indicated that those encoding C-type-lectins most likely originated from the wasp gene set, showing that a bracovirus-mediated gene flux exists between the 2 insect orders Hymenoptera and Lepidoptera. Furthermore, the acquisition of bracovirus sequences that can be expressed by Lepidoptera has resulted in the domestication of several genes that could result in adaptive advantages for the host. Indeed, functional analyses suggest that two of the acquired genes could have a protective role against a common pathogen in the field, baculovirus. From these results, we hypothesize that bracovirus-mediated HGT has played an important role in the evolutionary arms race between Lepidoptera and their pathogens.