Interactions between somatic and germline cells are critical for the normal development of egg and sperm. Here we show that the gene traffic jam (tj) produces a soma-specific factor that controls gonad morphogenesis and is required for female and male fertility. tj encodes the only large Maf factor in Drosophila melanogaster, an orthologue of the atypical basic Leu zipper transcription factors c-Maf and MafB/Kreisler in vertebrates. Expression of tj occurs in somatic gonadal cells that are in direct contact with germline cells throughout development. In tj mutant gonads, somatic cells fail to inter-mingle and properly envelop germline cells, causing an early block in germ cell differentiation. In addition, tj mutant somatic cells show an increase in the level of expression for several adhesion molecules. We propose that tj is a critical modulator of the adhesive properties of somatic cells, facilitating germline-soma interactions that are essential for germ cell differentiation.