Excitatory projections from the lateral hypothalamic area (LHA) to the lateral habenula (LHb) drive aversive responses. We used patch-sequencing (Patch-seq) guided multimodal classification to define the structural and functional heterogeneity of the LHA–LHb pathway. Our classification identified six glutamatergic neuron types with unique electrophysiological properties, molecular profiles and projection patterns. We found that genetically defined LHA–LHb neurons signal distinct aspects of emotional or naturalistic behaviors, such as estrogen receptor 1-expressing (Esr1+) LHA–LHb neurons induce aversion, whereas neuropeptide Y-expressing (Npy+) LHA–LHb neurons control rearing behavior. Repeated optogenetic drive of Esr1+LHA–LHb neurons induces a behaviorally persistent aversive state, and large-scale recordings showed a region-specific neural representation of the aversive signals in the prelimbic region of the prefrontal cortex. We further found that exposure to unpredictable mild shocks induced a sex-specific sensitivity to develop a stress state in female mice, which was associated with a specific shift in the intrinsic properties of bursting-type Esr1+LHA–LHb neurons. In summary, we describe the diversity of LHA–LHb neuron types and provide evidence for the role of Esr1+neurons in aversion and sexually dimorphic stress sensitivity.