The ability to recognize motivationally salient events and adaptively respond to them is critical for survival. Here we tested whether dopamine (DA) neurons in the dorsal raphe nucleus (DRN) contribute to this process in both male and female mice. Population recordings of DRN DA neurons during associative learning tasks showed that their activity dynamically tracks the motivational salience, developing excitation to both reward-and shock-paired cues. The DRN DA response to reward-predicting cues was diminished after satiety, suggesting modulation by internal states. DRN DA activity was also greater for unexpected outcomes than for expected outcomes. Two-photon imaging of DRN DA neurons demonstrated that the majority of individual neurons developed activation to reward-predicting cues and reward but not to shock-predicting cues, which was surprising and qualitatively distinct from the population results. Performing the same fear learning procedures in freely-moving and head-fixed groups revealed that headfixation itself abolished the neural response to aversive cues, indicating its modulation by behavioral context. Overall, these results suggest that DRN DA neurons encode motivational salience, dependent on internal and external factors. Significance statement Dopamine (DA) contributes to motivational control, composed of at least two functional cell typesone signaling for motivational value and another for motivational salience. Here we demonstrate that DA neurons in the dorsal raphe nucleus (DRN) encode the motivational salience in associative learning tasks. Neural responses were dynamic and modulated by the animal's internal state. The majority of single-cells developed responses to reward or paired cues, but not to shock-predicting cues. Further experiments with freely-moving and head-fixed mice showed that head-fixation abolished the development of cue responses during fear learning. This work provides further characterization on the functional roles of overlooked DRN DA populations and an example that neural responses can be altered by head-fixation, which is commonly used in neuroscience.