Transposable elements (TEs) are mobile DNA sequences that make up a large fraction of eukaryotic genomes. Recently it was discovered that PIWI-interacting RNAs (piRNAs), a class of small RNA molecules that are mainly generated from transposable elements, are crucial repressors of active TEs in the germline of fruit flies. By quantifying expression levels of 32 TE families in piRNA pathway mutants relative to wild-type fruit flies, we provide evidence that piRNAs can severely silence the activities of retrotransposons. We incorporate piRNAs into a population genetic framework for retrotransposons and perform forward simulations to model the population dynamics of piRNA loci and their targets. Using parameters optimized for Drosophila melanogaster, our simulation results indicate that (1) piRNAs can significantly reduce the fitness cost of retrotransposons; (2) retrotransposons that generate piRNAs (piRTs) are selectively more advantageous, and such retrotransposon insertions more easily attain high frequency or fixation; (3) retrotransposons that are repressed by piRNAs (targetRTs), however, also have an elevated probability of reaching high frequency or fixation in the population because their deleterious effects are attenuated. By surveying the polymorphisms of piRT and targetRT insertions across nine strains of D. melanogaster, we verified these theoretical predictions with population genomic data. Our theoretical and empirical analysis suggests that piRNAs can significantly increase the fitness of individuals that bear them; however, piRNAs may provide a shelter or Trojan horse for retrotransposons, allowing them to increase in frequency in a population by shielding the host from the deleterious consequences of retrotransposition.[Supplemental material is available online at http://www.genome.org.] Like other kinds of mutations, however, most mutations created by TE insertions are deleterious to the host and are thus selected against. Approximately 50%-80% of mutations arising in D. melanogaster can be attributed to TEs (Finnegan 1992;Ashburner et al. 2004). Based on the copy number of TEs in D. melanogaster, it was estimated that TEs can decrease the fitness of hosts by 0.4%-5% (Eanes et al. 1987;Charlesworth and Langley 1989;Mackay et al. 1992;Pasyukova et al. 2004). The fitness costs of TEs are generally mediated through the following mechanisms: (1) TE insertions disrupt genes (Charlesworth and Charlesworth 1983;Finnegan 1992;McDonald et al. 1997); (2) transcription and translation of TE-encoded genes are costly (Brookfield 1991; Nuzhdin 1999); and (3) ectopic recombination among dispersed and heterozygous TEs creates deleterious chromosomal rearrangements (Montgomery et al. 1987;Langley et al. 1988;Charlesworth and Langley 1989;Petrov et al. 2003). It has been demonstrated that different TE families are regulated by different mechanisms, although these mechanisms are not mutually exclusive (Biemont et al. 1994;Carr et al. 2002;Petrov et al. 2003). Despite their being under strong selective pressure, TEs ...