The germline mobilization of transposable elements (TEs) by small RNA mediated silencing pathways is conserved across eukaryotes and critical for ensuring the integrity of gamete genomes. However, genomes are recurrently invaded by novel TEs through horizontal transfer. These invading TEs are not targeted by host small RNAs, and their unregulated activity can cause DNA damage in germline cells and ultimately lead to sterility. Here we use hybrid dysgenesis-a sterility syndrome of Drosophila caused by transposition of invading P-element DNA transposons-to uncover host genetic variants that modulate dysgenic sterility. Using a panel of highly recombinant inbred lines of Drosophila melanogaster, we identified two linked quantitative trait loci (QTL) that determine the severity of dysgenic sterility in young and old females, respectively. We show that ovaries of fertile genotypes exhibit increased expression of splicing factors that suppress the production of transposase encoding transcripts, which likely reduces the transposition rate and associated DNA damage. We also show that fertile alleles are associated with decreased sensitivity to double-stranded breaks and enhanced DNA repair, explaining their ability to withstand high germline transposition rates. Together, our work reveals a diversity of mechanisms whereby host genotype modulates the cost of an invading TE, and points to genetic variants that were likely beneficial during the P-element invasion.