Secretions within the adult female reproductive tract mediate sperm survival, storage, activation, and selection. Drosophila female reproductive gland secretory cells reside within the adult spermathecae and parovaria, but their development remains poorly characterized.With cell-lineage tracing, we found that precursor cells downregulate lozenge and divide stereotypically to generate three-cell secretory units during pupal development. The NR5A-class nuclear hormone receptor Hr39 is essential for precursor cell division and secretory unit formation. Moreover, ectopic Hr39 in multiple tissues generates reproductive gland-like primordia. Rarely, in male genital discs these primordia can develop into sperm-filled testicular spermathecae.Drosophila spermathecae provide a powerful model for studying gland development. Hr39 functions as a master regulator of a program that may have been conserved throughout animal evolution for the production of female reproductive glands and other secretory tissues.