C. elegans hermaphrodites switch between two distinct behavioral states, roaming and dwelling, in which animals have high and low locomotor activity, respectively. Hermaphrodites spend most of the time in the dwelling state and various neuromodulators are involved in this regulation. However, the behavioral states of males have yet been studied. In this study, we analyzed sex differences in the behavioral states and found that males spend less time in the low activity state than hermaphrodites on food. In dopamine-deficient
cat-2 mutants, the dwelling state was increased in males and, as previously reported, decreased in hermaphrodites compared to the wildtype counterparts, suggesting that dopamine generates the sex differences in the behavioral states by having the opposite effects in males and hermaphrodites. We also found that, in males, dopamine reduces the dwelling state by acting in the same pathway as polycystic kidney disease-related genes, which function exclusively in male-specific neurons. In hermaphrodites, octopamine signaling in the sex-shared SIA neurons promotes locomotion and dopamine increases the dwelling state by suppressing the octopamine signaling. Calcium imaging showed that the SIA neurons of hermaphrodites respond to octopamine by evoking calcium oscillation. In contrast, the calcium response to octopamine was severely reduced in the SIA neurons of males. Furthermore, males explored a larger area of the bacteria lawn than hermaphrodites and dopamine was responsible for this sex difference. In addition, dopamine promotes exploration outside of a lawn in males and suppresses it in hermaphrodites: males leave a lawn at a much higher rate than hermaphrodites in the absence of mates and dopamine was also responsible for this difference. These behavioral differences are beneficial for males to find mates and hermaphrodites to stay with food. Together, the results demonstrate that dopamine controls behavioral states in the opposite way through sexually dimorphic signaling to promote adaptive behavior for each sex.