Summary1. Both evolutionary theory and empirical evidence from agricultural research support the view that asexual, vertically transmitted fungal endophytes are typically plant mutualists that develop high infection frequencies within host grass populations. In contrast, endophyte-grass interactions in natural ecosystems are more variable, spanning the range from mutualism to antagonism and comparatively little is known about their range of response to environmental stress. 2. We examined patterns in endophyte prevalence and endophyte-grass interactions across nutrient and grazing (from Greylag and Canada geese) gradients in 15 sites with different soil moisture levels in 13 island populations of the widespread grass Festuca rubra in a boreal archipelago in Sweden. 3. In the field, endophyte prevalence levels were generally low (range = 10-53%) compared with those reported from agricultural systems. Under mesic-moist conditions endophyte prevalence was constantly low (mean prevalence = 15%) and was not affected by grazing pressure or nutrient availability. In contrast, under conditions of drought, endophyte prevalence increased from 10% to 53% with increasing nutrient availability and increasing grazing pressure. 4. In the field, we measured the production of flowering culms, as a proxy for host fitness, to determine how endophyte-infected plants differed from uninfected plants. At dry sites, endophyte infection did not affect flowering culm production. In contrast, at mesic-moist sites production of flowering culms in endophyte-infected plants increased with the covarying effects of increasing nutrient availability and grazing pressure, indicating that the interaction switched from antagonistic to mutualistic. 5. A concurrent glasshouse experiment showed that in most situations, the host appears to incur some costs for harbouring endophytes. Uninfected grasses generally outperformed infected grasses (antagonistic interaction), while infected grasses outperformed uninfected grasses (mutualistic interaction) only in dry, nutrient-rich conditions. Nutrient and water addition affected tiller production, leaf number and leaf length differently, suggesting that tillers responded with different strategies. This emphasizes that several response variables are needed to evaluate the interaction. 6. Synthesis. This study found complex patterns in endophyte prevalence that were not always correlated with culm production. These contrasting patterns suggest that the direction and strength of selection on infected plants is highly variable and depends upon a suite of interacting environmental variables that may fluctuate in the intensity of their impact, during the course of the host life cycle.