Domatia are hollow structures in plants occupied by ant colonies, in turn ants provide protection against herbivores. In plants, competition for resources has driven sex-related changes in the patterns of resource allocation to life-history traits and defence traits. The resource-competition hypothesis (RCH) proposes that female plants due to their higher investment in reproduction will allocate fewer resources to defence production, showing greater herbivore damage than other sexual forms. We hypothesise the existence of sex-related differences in defensive traits of domatia-bearing plants, being female plants less defended due to differences in domatia traits, such as size, number of domatia and their position, exhibiting more herbivore damage than hermaphrodite plants of Myriocarpa longipes, a facultative neotropical myrmecophyte. We found eight species of ants inhabiting domatia; some species co-inhabited the same plant, even the same branch. Our results are consistent with the predictions of RCH, as female plants had ant-inhabited domatia restricted to the middle position of their branches and exhibited greater herbivore damage in leaves than hermaphrodites. However, we did not find differences in domatia size and leaf area between sexual forms. Our study provides evidence for intersexual differences in domatia position and herbivory in a facultative ant–plant mutualism in M. longipes. We highlight the importance of considering the plant sex in ant–plant interactions. Differences in resource allocation related to sexual reproduction could influence the outcome of ant–plant interactions.