Adult male and lactating female olive baboons (Papio hamadryas anubis) form non-sexual attachments described by researchers as "friendships." Explanations for the evolutionary function of baboon friendship for males and females have been debated by many primatologists, but have yet to be determined conclusively. I tested hypotheses concerning the adaptive significance of friendship for each sex with analyses of fecal hormones. For males, I examined the association between testosterone and glucocorticoids, and friendship formation and maintenance. For lactating females, I investigated the association between glucocorticoid concentrations and friendship. Fecal samples and data on social behavior and spatial relations were collected from 26 adult male and 22 lactating female baboons in two study groups located in Laikipia, Kenya. Hormone concentrations were assessed by radioimmunoassay. Friendships were determined from composite proximity scores (C-scores) calculated for each male-female dyad in the groups.;In male friends, profiles for testosterone, but not glucocorticoids, were consistent with a "paternal care" hormonal profile found in pair bonded primates and rodents. I argue that testosterone concentrations in male baboons suggest a hormonal mechanism underlying friendship and paternal solicitude similar to that in other mammals. The glucocorticoid profile of male friends led me to an alternative conclusion: periparturition and chronic elevation of glucocorticoids in male baboons during the lactation phase of their female friends functions to decrease testosterone and thereby divert male behavioral strategies from male-male competition and mating effort toward friendship with lactating females (and their infants).;In lactating females, glucocorticoid levels were consistent with the hypothesis that male friends buffer lactating females from harassment induced stress. More particularly, my data suggest that lactating females are susceptible to stress from harassment by adult males rather than higher-ranking females, and that male friends may serve a protective function.