The doublesex (dsx) gene regulates somatic sexual differentiation in both sexes in D. melanogaster. Two functional products are encoded by dsx: one product is expressed in females and represses male differentiation, and the other is expressed in males and represses female differentiation. We have determined that the dsx gene is transcribed to produce a common primary transcript that is alternatively spliced and polyadenylated to yield male- and female-specific mRNAs. These sex-specific mRNAs share a common 5' end and three common exons, but possess alternative sex-specific 3' exons, thus encoding polypeptides with a common amino-terminal sequence but sex-specific carboxyl termini. Genetic and molecular data suggest that sequences including and adjacent to the female-specific splice acceptor site play an important role in the regulation of dsx expression by the transformer and transformer-2 loci.