Transposable elements can drive genome evolution, but their enhanced activity is detrimental to the host and therefore must be tightly regulated. The Piwi-interacting small RNA (piRNA) pathway is vital for the regulation of transposable elements, by inducing transcriptional silencing or post-transcriptional decay of mRNAs. Here we show that piRNAs and piRNA biogenesis components regulate precursor mRNA splicing of P-transposable element transcripts in vivo, leading to the production of the non-transposase-encoding mature mRNA isoform in Drosophila germ cells. Unexpectedly, we show that the piRNA pathway components do not act to reduce transcript levels of the P-element transposon during P-M hybrid dysgenesis, a syndrome that affects germline development in Drosophila. Instead, splicing regulation is mechanistically achieved together with piRNA-mediated changes to repressive chromatin states, and relies on the function of the Piwi-piRNA complex proteins Asterix (also known as Gtsf1) and Panoramix (Silencio), as well as Heterochromatin protein 1a (HP1a; encoded by Su(var)205). Furthermore, we show that this machinery, together with the piRNA Flamenco cluster, not only controls the accumulation of Gypsy retrotransposon transcripts but also regulates the splicing of Gypsy mRNAs in cultured ovarian somatic cells, a process required for the production of infectious particles that can lead to heritable transposition events. 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.