Noradrenaline modulates global brain states and diverse behaviors through what is traditionally believed to be a homogeneous cell population in the brainstem locus coeruleus (LC). However, it is unclear how LC coordinates disparate behavioral functions. We report a modular LC organization in rats, endowed with distinct neural projection patterns and coding properties for flexible specification of opposing behavioral learning states. LC projection mapping revealed functionally distinct cell modules with specific anatomical connectivity. An amygdala-projecting ensemble promoted aversive learning, while an independent medial prefrontal cortex-projecting ensemble extinguished aversive responses to enable flexible behavior. LC neurons displayed context-dependent inter-relationships, with moderate, discrete activation of distinct cell populations by fear or safety cues and robust, global recruitment of most cells by strong aversive stimuli. These results demonstrate a modular organization in LC in which combinatorial activation modes are coordinated with projection- and behavior-specific cell populations, enabling adaptive tuning of emotional responding and behavioral flexibility.