Electrophysiological recordings have enabled identification of physiologically distinct yet behaviorally similar states of mammalian sleep. In contrast, sleep in nonmammals has generally been identified behaviorally and therefore regarded as a physiologically uniform state characterized by quiescence of feeding and locomotion, reduced responsiveness, and rapid reversibility. The nematode Caenorhabditis elegans displays sleep-like quiescent behavior under two conditions: developmentally timed quiescence (DTQ) occurs during larval transitions, and stress-induced quiescence (SIQ) occurs in response to exposure to cellular stressors. Behaviorally, DTQ and SIQ appear identical. Here, we use optogenetic manipulations of neuronal and muscular activity, pharmacology, and genetic perturbations to uncover circuit and molecular mechanisms of DTQ and SIQ. We find that locomotion quiescence induced by DTQ- and SIQ-associated neuropeptides occurs via their action on the nervous system, although their neuronal target(s) and/or molecular mechanisms likely differ. Feeding quiescence during DTQ results from a loss of pharyngeal muscle excitability, whereas feeding quiescence during SIQ results from a loss of excitability in the nervous system. Together these results indicate that, as in mammals, quiescence is subserved by different mechanisms during distinct sleep-like states in C. elegant.