Sex peptide, a secreted component of the male accessory glands, has been shown to induce behavioral and physiological changes in mated Drosophila. We transformed flies with a hybrid gene containing an hsp70 promoter fused to a cDNA encoding sex peptide. Heat-induced ectopic expression of the peptide in transgenic virgin females altered their reproductive behavior, in the presence of courting males, to that observed in mated females. This demonstrates that the peptide is functional as expected. Time course studies revealed that the behavioral change appeared earlier than the stimulated ovulation. We have also introduced a modified sex peptide gene that is driven by the yp1 enhancer, conferring expression in adult females, and shown that these flies refuse mating constitutively in the presence of courting males and lay unfertilized eggs at the rate of mated females.