Horizontal gene transfer (HGT) is an important evolutionary force shaping prokaryotic and eukaryotic genomes. HGT-acquired genes have been sporadically reported in insects, a lineage containing >50% of animals. We systematically examined HGT in 218 high-quality genomes of diverse insects and found that they acquired 1,410 genes exhibiting diverse functions, including many not previously reported, via 741 distinct transfers from non-metazoan donors. Lepidopterans had the highest average number of HGT-acquired genes. HGT-acquired genes containing introns exhibited substantially higher expression levels than genes lacking introns, suggesting that intron gains were likely involved in HGT adaptation. Lastly, we used the CRISPR-Cas9 system to edit the prevalent unreported gene LOC105383139 , which was transferred into the last common ancestor of moths and butterflies. In diamondback moths, males lacking LOC105383139 courted females significantly less. We conclude that HGT has been a major contributor to insect adaptation. [Display omitted] • Genome-scale screening of HGT in 218 insect genomes • Intron gains from native insect genomes were likely involved in HGT adaptation • Lepidopterans acquired, on average, the highest number of HGT-acquired genes • HGT-acquired gene enhances male courtship behavior in lepidopterans A comprehensive resource of horizontal gene transfer (HGT) events in 218 insects acquired from non-metazoan sources provides insight into the adaptation of HGTs in insect genomes with the discovery of a functional role for the gene LOC105383139 in male courtship behavior in lepidopterans. [ABSTRACT FROM AUTHOR]