Neuromodulators shape neural circuit dynamics. Combining electron microscopy, genetics, transcriptome profiling, calcium imaging, and optogenetics, we discovered a peptidergic neuron that modulates C. elegans motor circuit dynamics. The Six/SO-family homeobox transcription factor UNC-39 governs lineage-specific neurogenesis to give rise to a neuron RID. RID bears the anatomic hallmarks of a specialized endocrine neuron: it harbors near-exclusive dense core vesicles that cluster periodically along the axon, and expresses multiple neuropeptides, including the FMRF-amide-related FLP-14. RID activity increases during forward movement. Ablating RID reduces the sustainability of forward movement, a phenotype partially recapitulated by removing FLP-14. Optogenetic depolarization of RID prolongs forward movement, an effect reduced in the absence of FLP-14. Together, these results establish the role of a neuroendocrine cell RID in sustaining a specific behavioral state in C. elegans.