Abstract. The net benefits of mutualism depend directly on the costs and effectiveness of mutualistic services and indirectly on the interactions that affect those services. We examined interactions among Cordia alliodora myrmecophytic trees, their symbiotic ants Azteca pittieri, coccoid hemipterans, and foliar herbivores in two Neotropical dry forests. The tree makes two investments in symbiotic ants: it supplies nesting space, as domatia, and it provides phloem to coccoids, which then produce honeydew that is consumed by ants. Although higher densities of coccoids should have higher direct costs for trees, we asked whether higher densities of coccoids can also have higher indirect benefits for trees by increasing the effectiveness of ant defense against foliar herbivores. We found that trees benefited from ant defense against herbivores. Ants defended trees effectively only when colonies reached high densities within trees, and ant and coccoid densities within trees were strongly positively correlated. The benefits of reduced foliar herbivory by larger ant colonies were therefore indirectly controlled by the number of coccoids. Coccoid honeydew supply also affected per capita ant aggression against tree herbivores. Ants experimentally fed a carbohydrate-rich diet, analogous to sugar obtained from coccoids, were more aggressive against caterpillars per capita than ants fed a carbohydrate-poor diet. Ant defense was more effective on more valuable and vulnerable young leaves than on older leaves. Young domatia, associated with young leaves, contained higher coccoid densities than older domatia, which suggests that coccoids may also drive spatially favorable ant defense of the tree. If higher investments by one mutualistic partner are tied to higher benefits received from the other, there may be positive feedback between partners that will stabilize the mutualism. These results suggest that higher investment by trees in coccoids leads to more effective defense by ants against the tree's foliar herbivores.