Opposites don’t necessarily attract in the primate world.

According to a new study, chimpanzees choose their friends based on similar personality types. The findings, published in the scientific journal Evolution and Human Behaviour, reveals how the primates choose their partners based on their behavior and emotional states.

"We found that, especially among unrelated friends, the most sociable and bold individuals preferred the company of other highly sociable and bold individuals, whereas shy and less sociable ones spent time with other similarly aloof and shy chimpanzees,” Jorg Massen of the University of Vienna said in a statement.

The research team observed 38 chimpanzees in two zoos and tracked who they came into contact with the most, who they sat with and whether they had different personality types.

“The groups consisted of many males and females, and individuals formed cooperative friendships,” co-author Sonja Koski of the University of Zurich told Discovery News. “Our results suggest that the preference to form these friendships with individuals much like oneself was present in the ancestor of chimpanzees and humans.”

Much like the “similarity effect” in humans where individuals choose to befriend those who share common personality traits, chimpanzees make friends the same way.

"It appears that what draws and keeps both chimpanzee and human friends together is similarity in gregariousness and boldness, suggesting that preference for self-like friends dates back to our last common ancestor," Massen said.

Previous studies that have observed the social habits of other primates like baboons shared similar results.

“In our own work on baboons, we have found that certain pairs of females form social bonds that are characterized by high levels of friendly interactions and well-balanced grooming relationships; high ratios of friendly to aggressive interactions; and higher levels of support in agonistic conflicts,” anthropologist Joan Silk of the University of California at Los Angeles told Discovery News, adding that the strongest relationships were the most enduring.

An earlier study published in January revealed why chimpanzees form non-kin relationships altogether. According to a research team from the Max Planck Institute for Evolutionary Anthropology in Leipzig, Germany, chimpanzees had increased levels of the hormone oxytocin which is normally associated with mother-baby and pair bonds.

"Until now... it's pretty much been thought that tactile stimulation [for example] gentle stroking is enough to stimulate oxytocin,” research team member Catherine Crockford told the BBC. "But this clearly shows that's not the case, that you need more than just that. There needs to be some sort of psychological component really, this added factor of the relationship itself and the quality of the relationship."