BACKGROUNDFertiliser applications are well‐established tools in pasture‐based agricultural landscapes. This study focuses on the impact of phosphorus (P) fertiliser on grass grub (Costelytra giveni), a major pasture pest. This research investigates the interplay between P, plant growth, and grass grub fitness in Epichloë endophyte‐infected perennial ryegrass (Epichloë sp. LpTG‐3 strain AR37) and meadow fescue infected with E. uncinata (strain MaxR; AR1017), alongside their endophyte‐free counterparts. In a glasshouse trial, plants were grown in P‐enriched soil with varying Olsen P levels (9, 18, 28 or 78 mg L−1), and grass grubs were introduced. Their survival and weight gain, and plant performance were measured. In a bioassay, grass grubs were placed in specimen vials with P‐enriched soils (Olsen P levels 9, 18, 28 and 78 mg L−1) and provided with identical plant material to assess their diet consumption and weight gain.RESULTSIn the glasshouse trial, results highlighted a notable decrease in the survival of grass grub on plants infected with MaxR endophyte, but not with AR37, as well as increasing soil Olsen P levels in both plant species. While grass grub decreased plant performance at the low Olsen P level (9 mg L−1), this effect diminished with increasing P. Likewise, results from the bioassay showed a decrease in diet consumption with increasing soil Olsen P levels. In both trials increasing Olsen P levels correlated with diminished grass grub performance, revealing a nuanced relationship between soil fertility and pest dynamics.CONCLUSIONThe study underscores the pivotal role of selected Epichloë endophyte–grass associations in mitigating grass grub damage across varying phosphorus levels. This study highlights the potential to integrate P applications for sustainable pest control against grass grub. Further field trials are required to validate these findings. © 2024 The Author(s). Pest Management Science published by John Wiley & Sons Ltd on behalf of Society of Chemical Industry.