Transposable elements can drive genome evolution, but their enhanced activity is detrimental to the host and therefore must be tightly regulated1. The piwi-interacting small RNAs (piRNAs) pathway is critically important for transposable element regulation, by inducing transcriptional silencing or post-transcriptional decay of mRNAs2. Here, we show that piRNAs and piRNA biogenesis components regulate pre-mRNA splicing of P transposable element transcripts in vivo, leading to the production of the non-transposase-encoding mature mRNA isoform in germ cells. Unexpectedly, we show that the piRNA pathway components do not act to reduce P-element transposon transcript levels during P-M hybrid dysgenesis, a syndrome that affects germline development in Drosophila3,4. Instead, splicing regulation is mechanistically achieved in concert with piRNA-mediated changes to repressive chromatin states, and relies on the function of the Piwi-piRNA complex proteins Asterix/Gtsf15–7 and Panoramix/Silencio8,9, as well as Heterochromatin Protein 1a (Su(var)205/HP1a). Furthermore, we show that this machinery, together with the piRNA Flamenco cluster10, not only controls the accumulation of Gypsy retrotransposon transcripts11 but also regulates splicing of Gypsy mRNAs in cultured ovarian somatic cells, a process required for the production of infectious particles that can lead to heritable transposition events12,13. Our findings identify splicing regulation as a new role and essential function for the Piwi pathway in protecting the genome against transposon mobility, and provide a model system for studying the role of chromatin structure in modulating alternative splicing during development.