Neurons typically release both a neurotransmitter and one or more neuropeptides, but how these signals are integrated within neural circuits to generate and tune behaviors remains poorly understood. We studied how the two hermaphrodite-specific neurons (HSNs) activate the egg-laying circuit of Caenorhabditis elegans by releasing both the neurotransmitter serotonin and NLP-3 neuropeptides. Egg laying occurs in a temporal pattern with approximately 2-min active phases, during which eggs are laid, separated by approximately 20-min inactive phases, during which no eggs are laid. To understand how serotonin and NLP-3 neuropeptides together help produce this behavior pattern, we identified the G-protein-coupled receptor neuropeptide receptor 36 (NPR-36) as an NLP-3 neuropeptide receptor using genetic and molecular experiments. We found that NPR-36 is expressed in, and promotes egg laying within, the egg-laying muscle cells, the same cells where two serotonin receptors also promote egg laying. During the active phase, when HSN activity is high, we found that serotonin and NLP-3 neuropeptides each have a different effect on the timing of egg laying. During the inactive phase, HSN activity is low, which may result in release of only serotonin, yet mutants lacking either serotonin or nlp-3 signaling have longer inactive phases. This suggests that NLP-3 peptide signaling may persist through the inactive phase to help serotonin signaling terminate the inactive phase. We propose a model for neural circuit function in which multiple signals with short- and long-lasting effects compete to generate and terminate persistent internal states, thus patterning a behavior over tens of minutes.