Germ cells must develop along distinct male or female paths to produce the sperm or eggs required for sexual reproduction. In both mouse and Drosophila, the sexual identity of germ cells is influenced by the sex of the surrounding somatic tissue (for example, refs 1, 2, reviewed in refs 3, 4); however, little is known about how the soma controls germline sex determination. Here we show that the janus kinase/signal transducer and activator of transcription (JAK/STAT) pathway provides a sex-specific signal from the soma to the germ line in Drosophila embryonic gonads. The somatic gonad expresses a JAK/STAT ligand, unpaired (upd), in a male-specific manner, and activates the JAK/STAT pathway in male germ cells at the time of gonad formation. Furthermore, the JAK/STAT pathway is necessary for male-specific germ cell behaviour during early gonad development, and is sufficient to activate aspects of male germ cell behaviour in female germ cells. Our findings provide direct evidence that the JAK/STAT pathway mediates a key signal from the somatic gonad that regulates male germline sexual development.