Ryegrass pastures in New Zealand are usually infected with the ryegrass endophyte (Neotyphodium lolii). The endophyte provides protection from invertebrate attack, discourages overgrazing by livestock and perhaps confers other advantages enhancing ryegrass persistence. The endophyte lifecycle is completed within the plant, and transmission is uniquely through the grass seed. Within the plant, the endophyte synthesises a range of compounds, some of which have been identified as responsible for known endophyte effects on pasture invertebrates and on livestock. The concentrations of these compounds vary in different parts of the plant, with plant age and in response to environmental influences. While endophyte has wellknown adverse effects on livestock (reviewed elsewhere in this volume), it contributes positively to grassland productivity in New Zealand. Keywords: endophyte, Lolium, Neotyphodium lolii, pest resistance, ryegrass