The assembly of plant microbial communities is a complex process orchestrated by plant physiology and microbial interactions under changing environmental conditions. In this work we aim to disentangle how an aggressive vascular pathogen, Ophiostoma novo-ulmi, affects the composition of the resident mycobiome of field elm ( Ulmus minor). We also aim to determine the extent to which the inoculation of beneficial endophytes buffers the changes induced by the pathogen in the resident mycobiome composition. Three U. minor genotypes, two resistant and one susceptible to O. novo-ulmi, were inoculated with (i) the pathogen, (ii) a consortium of three beneficial endophytes, or (iii) the endophyte consortium, followed by pathogen inoculation. Endophyte composition of stem samples was profiled by high-throughput sequencing of the first internal transcribed spacer region of the ribosomal DNA. A total of 365 amplicon sequence variants (ASVs) were obtained, 61 of which were core members. Pathogen colonization reduced the ASV richness while endophyte inoculation increased the Shannon diversity. In most cases, the endophyte consortium inoculation prevented most of the changes in the mycobiome composition induced by the pathogen. At the genotype level, both alpha and beta diversity varied strongly, with latent pathogens being more abundant in the susceptible genotype. Overall, the results are evidence that inoculation of plant beneficial endophytes buffers the changes produced in the mycobiome by aggressive pathogens. [Formula: see text] Copyright © 2023 The Author(s). This is an open access article distributed under the CC BY-NC-ND 4.0 International license .