It is well documented that ants can protect plants against insect herbivores, but the underlying mechanisms remain almost undocumented. We propose and test the pheromone avoidance hypothesis—an indirect mechanism where insect herbivores are repelled not only by ants but also by ant pheromones. Herbivores subjected to ant predation will experience a selective advantage if they evolve mechanisms enabling them to avoid feeding within ant territories. Such a mechanism could be based on the ability to detect and evade ant pheromones. Field observations and data from the literature showed that the ant Oecophylla smaragdina distributes persistent pheromones throughout its territory. In addition, a laboratory test showed that the beetle Rhyparida wallacei, which this ant preys on, was reluctant to feed on leaves sampled within ant territories compared with leaves sampled outside territories. Thus, this study provides an example of an ant–herbivore system conforming to the pheromone avoidance hypothesis.