In polyandrous females, sperm storage permits competition between sperm of different mates, and in some species females influence the relative fertilization success of competing sperm in favor of a preferred mate <up>1, 2</up>. In female Drosophila melanogaster, sperm competition is strongly influenced by the timing of sperm ejection from the uterus <up>3, 4</up>. Understanding how female behavior influences sperm competition requires knowledge of the neuronal mechanisms controlling sperm retention and storage, which is currently lacking. Here, we show that D. melanogaster females eject male ejaculates from the uterus 1-6 hr after mating with a stereotypic behavior regulated by a brain signaling pathway composed of diuretic hormone 44 (Dh44), a neuropeptide related to vertebrate corticotropin-releasing factor (CRF), and its receptor, Dh44R1. Suppression of Dh44 signals in the brain expedites sperm ejection from the uterus, resulting in marked reduction of sperm in the storage organs and decreased fecundity, whereas enhancement of Dh44 signals delays sperm expulsion. The Dh44 function was mapped to six neurons located in the pars intercerebralis of the brain together with a small subset of Dh44R1 neurons that express the sex-specific transcription factor doublesex. This study identifies a neuronal pathway by which females can control sperm retention and storage and provides new insight into how the female might exercise post-copulatory sexual selection.