1. Many flowers produce ant-repellent substances that prevent ants from discouraging pollinator visits. When a flower's most effective pollinator is unaffected by predatory ants, however, flowers should benefit from the presence of ants that deter less effective pollinators from consuming resources.
2. Behavioural assays revealed that Melastoma malabathricum flowers, pollinated by large carpenter bees, Xylocopa spp., produce ant attractants that recruit weaver ants, Oecophylla smaragdina.
3. The presence of ants was associated with an increase in the reproductive success of M. malabathricum flowers. This outcome likely resulted from the filtering effect of ants on the community of flower visitors: ants deter less effective pollinators and attract Xylocopa bees through an indirect effect on resource depletion.
4. Synthesis. Although plant–pollinator interactions are classified as mutualisms, not all flower visitors are effective pollinators, and some can be parasites or conditional parasites. As a result, predators that deter flower visitors can have positive or negative effects on plant fitness, depending on whether they deter all visitors or a subset of them, and on the relative effectiveness of deterred and undeterred visitors.