The ability to distinguish a threatening from non-threatening conspecific based on past experience is critical for adaptive social behaviors. Although recent progress has been made in identifying the neural circuits that contribute to different types of positive and negative social interactions, the neural mechanisms that enable the discrimination of individuals based on past aversive experiences remain unknown. Here, we developed a modified social fear conditioning paradigm that induced in both sexes robust behavioral discrimination of a conspecific associated with a footshock (CS+) from a non-reinforced interaction partner (CS-). Strikingly, chemogenetic or optogenetic silencing of hippocampal CA2 pyramidal neurons, which have been previously implicated in social novelty recognition memory, resulted in generalized avoidance fear behavior towards the equally familiar CS-and CS+. One-photon calcium imaging revealed that the accuracy with which CA2 representations discriminate the CS+ from the CS-animal was enhanced following social fear conditioning and strongly correlated with behavioral discrimination. Moreover the CA2 representations incorporated a generalized or abstract representation of social valence irrespective of conspecific identity and location. Thus, our results demonstrate, for the first time, that the same hippocampal CA2 subregion mediates social memories based on conspecific familiarity and social threat, through the incorporation of a representation of social valence into an initial representation of social identity.