Graphical abstract Highlights • A fertilizer with diazotrophic bacteria and C. elegans was tested against B. xylophilus. • In control P. pinaster nematodes number increased 2.3-fold 24 days post inoculation. • P. pinea untreated plants showed no nematode increase during the experimental period. • P. pinaster treatment with biofertilizer decreased nematodes number up to 36.3-fold. • The biofertilizer prevented the decrease of photosynthetic pigments and water content. Abstract The pine wilt disease (PWD), caused by the pine wood nematode (PWN) Bursaphelenchus xylophilus , is a devastating illness that mainly affects P. pinaster trees, and that poses great environmental and economic challenges. Current disease management involves the cut down of infected trees, tree fumigation, use of nematicides, or the control of the insect vector; however, these methodologies are expensive, labour-intensive and have limited success. The aim of this work was to evaluate the effect of a biofertilizer enriched with diazotrophic bacteria and a chitosan-producing fungus, Cunninghamella elegans , in inducing P. pinaster and P. pinea resistance against the PWN. In non-inoculated (control) P. pinaster plants, PWN population significantly increased (ca. 2.3-fold) throughout the experimental period, whereas in plants treated with 7.5 and 15% of biofertilizer nematode numbers were up to 36.3-fold lower than in control plants. In P. pinea , nematode numbers decreased with time for all biofertilizer concentrations tested, and P. pinea had up to 27.3-fold lower nematode counts than P. pinaster. In addition, the biofertilizer prevented the decrease of photosynthetic pigments and the reduction of water content in infected P. pinaster plants. In P. pinea the biosynthesis of phenolics increased in PWN-inoculated plants, especially in the presence of the biofertilizer. The addition of this biofertilizer to soils forested by P. pinaster may improve plant defence and could be a potentially simple and inexpensive strategy for the control of the PWD. [ABSTRACT FROM AUTHOR]