A key function of religious rituals is their ability to connect or bond individuals. Recent advances on the neurobiological underpinnings of bonding, highlighting how opioids are activated in the brain by social activities, can now be applied to the study of rituals. Here we present the results of a large-scale field study conducted across the UK and Brazil where we examined the psychobiological functions of rituals, following the brain-opioid theory of social attachment (BOTSA). Testing was conducted across 24 sessions at Christian and Afro-Brazilian religious rituals (N=358), with measures taken before and after each ritual. Regression analysis and multilevel linear modelling showed that taking part in religious rituals increased both pain threshold (a proxy for opioid activation) and positive affect, and that these enhanced the sense of bonding to one’s religious group. The results suggest that one of the key functions of religious ritual is to increase community bonding.