Serotonin (5-HT) is a neuromodulator that regulates many aspects of animal behavior, including mood, aggression, sex drive, and sleep. In vertebrates, most of the behavioral effects of 5-HT appear to be mediated by G-protein-coupled receptors (GPCRs). Here, we show that SER-1 is the 5-HT GPCR responsible for the stimulatory effects of exogenous 5-HT in two sexually dimorphic behaviors of Caenorhabditis elegans, egg laying and male ventral tail curling. Loss of ser-1 function leads to decreased egg laying in hermaphrodites and defects in the turning step of mating behavior in males. ser-1 is expressed in muscles that are postsynaptic to serotonergic neurons and are known to be required for these behaviors. Analysis of the ser-1 mutant also reveals an inhibitory effect of 5-HT on egg laying that is normally masked by SER-1-dependent stimulation. This inhibition of egg laying requires MOD-1, a 5-HT-gated chloride channel. Loss of mod-1 function in males also produces defects in ventral tail curling and enhances the turning defects in ser-1 mutant males. Sustained elevations in 5-HT levels result in behavioral adaptation to both the stimulatory and inhibitory actions of the neurotransmitter, indicating that both SER-1 and MOD-1 signaling can be modulated. Removal of wild-type animals from high levels of exogenous 5-HT produces a SER-1-dependent withdrawal response in which egg laying is significantly decreased. These studies provide insight into the role of 5-HT in behavior and the regulation of 5-HT(2) receptor function.