The preservation of germ cell sexual identity is essential for gametogenesis. Here we show that H3K9me3-mediated gene silencing is integral to female fate maintenance in Drosophila germ cells. Germ cell specific loss of the H3K9me3 pathway members, the H3K9 methyltransferase SETDB1, WDE, and HP1a, leads to ectopic expression of genes, many of which are normally expressed in testis. SETDB1 controls the accumulation of H3K9me3 over a subset of these genes without spreading into neighboring loci. At phf7, a regulator of male germ cell sexual fate, the H3K9me3 peak falls over the silenced testis-specific transcription start site. Furthermore, H3K9me3 recruitment to phf7 and repression of testis-specific transcription is dependent on the female sex determination gene Sxl. Thus, female identity is secured by an H3K9me3 epigenetic pathway in which Sxl is the upstream female-specific regulator, SETDB1 is the required chromatin writer, and phf7 is one of the critical SETDB1 target genes.