A large body of evidence links altered opioid signaling with changes in social behavior in animals. However, few studies have attempted to determine whether similar links exist in humans. Here we investigate whether a common polymorphism (A118G) in the mu-opioid receptor gene (OPRM1) is associated with alterations in personality traits linked to affiliative behavior and attachment. In a mixed sample (N = 214) of adult healthy volunteers and psychiatric patients, we analyzed the association between the A118G polymorphism of the OPRM1 and two different psychological constructs reflecting individual differences in the capacity to experience social reward. Compared to individuals expressing only the major allele (A) of the A118G polymorphism, subjects expressing the minor allele (G) had an increased tendency to become engaged in affectionate relationships, as indicated by lower scores on a self-report measure of avoidant attachment, and experienced more pleasure in social situations, as indicated by lower scores on a self-report measure of social anhedonia. The OPRM1 variation accounted for about 3.5% of the variance in the two measures. The significant association between the A118G polymorphism and social hedonic capacity was independent of the participants' mental health status. The results reported here are in agreement with the brain opioid hypothesis of social attachment and the established role of opioid transmission in mediating affiliative behavior.