1 Variation in antiherbivore defences among individuals within a plant species may be influenced by intrinsic characteristics of the plant, environmental conditions and the interactions between these factors. 2 We used a long-term field experiment and a laboratory palatability trial to elucidate the effects of plant age, nutrient availability and ant occupancy on herbivore damage sustained by Cordia alliodora, a common neotropical myrmecophyte. 3 Herbivory in this system was influenced by both plant characteristics and environmental conditions, and the relative importance of these variables changed with plant age. 4 Five-year-old plants had a higher frequency of ant occupation and more workers per domatium than 1-year-old plants. 5 Plant age did not significantly affect herbivory in either field studies or laboratory palatability trials conducted with a specialist herbivore. In the field, however, 1-year-old plants tended to have higher levels of herbivory than 5-year-old plants. 6 There was a trend towards lower herbivory in trees that had been fertilized. Additionally, leaves from fertilized trees were significantly less palatable to specialist herbivores. 7 In 1-year-old plants, the abundance of ants in domatia had no effect on herbivory of nearby leaves. In contrast, ant abundance and herbivory were negatively correlated for 5-year-old trees, demonstrating that ants provide effective defence only for older plants. 8 These results suggest that understanding ant-plant-herbivore relationships requires examining how biotic and abiotic factors and their interactions change with plant ontogeny. Although our work focused on one particular ant-plant system, the importance of ontogenetic variation in antiherbivore defence is increasingly recognized as a critical area of study in plant defence theory.