The conserved THO/TREX complex is participated in pre-mRNA processing and mRNA nuclear export. In Metazoa, it has been reported that THO/TREX is loaded on nascent RNA transcribed by RNA polymerase II in a splicing-dependent manner; however, how THO/TREX functions is poorly understood. To understand the role of THO/TREX in eukaryotic gene expression, we investigated the role of THO/TREX in Drosophila germline, and found that lack of THOC5, a component of THO/TREX, showed defects in the biogenesis of piRNA, a distinct class of small non-coding RNAs that control expression of transposable elements (TE) in the Drosophila germline. Genome wide RNA-seq showed that THOC5 and other TREX components are essential for the biogenesis of piRNA. THO/TREX components are enriched on piRNA precursors transcribed from dual-strand piRNA clusters and co-localize in distinct nuclear foci that overlap with sites of piRNA transcription. The localization of TREX in nuclear foci and its loading on piRNA precursor transcripts depends on Cutoff, a protein associated with chromatin of piRNA clusters. We also show that TREX is required for accumulation of nascent piRNA precursors, suggesting that TREX is required for their efficient transcription. In addition to the biogenesis of piRNA, both THO and piRNA mutants showed over-proliferation of germline stem cell-like cells outside of stem cell niche. Taken together our study reveals a novel splicing-independent mechanism for THO/TREX loading on nascent RNA and its importance in piRNA biogenesis as well as a role of piRNA in the differentiation of germline stem cell.