1. In exchange for extrafloral nectar, ants deter herbivores from the plants decreasing the herbivore damage, and increasing plant performance in terms of growth and survival. Plants of different sexes may exhibit differences in the investment of resources for defence, thereby differentially decreasing the amount of energy available to other physiological processes. In this context, little is known about sex-related differences in the outcome of ant-plant interactions in plants bearing extrafloral nectaries (EFNs).2. In the present study, we conducted ant-exclusion experiments in the field to test for sex-related differences in the outcome of ant-plant interactions in vegetative and reproductive buds of Opuntia robusta in individuals of different sexes in two populations: trioecious and dioecious. We applied tanglefoot to some plant and others were allowed ant access, and measured herbivory, relative growth rates and survival probabilities of buds during the growing season when EFNs are active. We counted the number of ants foraging in EFNs of flowers and cladodes of different sexes. We hypothesized that differences in resource investment to defence between sexes change the outcome of ant-plant interactions in terms of the number of ants foraging on EFNs, herbivory, growth, and survival probabilities.3. Our results suggest sex-specific strategies in the investment of resources for defence mediated by EFNs in O. robusta, wherein males, females and hermaphrodites from both populations respond differentially to ant presence and herbivores.These sex-related differences affected the outcome of the ant-plant interactions, influencing changes in number of ants foraging on EFNs, and the resulting herbivory, growth and survival of flowers and cladodes among the different sexes and among populations. Our results suggest that the maintenance of EFNs in O. robusta is costly, reflecting some trade-offs between growth/survival and defence. Buds visited by ants tended to grow slowly and survive worse in the trioecious population; in the dioecious population they grew slower but survived better. Overall, a greater number of ants visiting EFNs was related to lower herbivore damage, greater growth and survival of flowers and cladodes. Our study underscores the importance of considering plant sex in the outcome of ant-plant interactions.