Bursaphelenchus xylophilus, the causative agent of pine wilt disease (PWD), is an ever-increasing threat to Pinus forests worldwide. This study aimed to develop biological control of PWD by the application of endophytic fungi isolated from healthy pine trees. We successfully isolated a novel endophytic fungal strain 1-24-2 from branches of healthy Pinus massoniana. The culture filtrates (CFs) of strain 1-24-2 exhibited strong nematicidal activity against Bursaphelenchus xylophilus, with a corrected mortality rate of 99.00%. Based on the morphological and molecular characteristics, the isolated strain 1-24-2 was identified as Chaetomium ascotrichoides. In the in-planta assay, pine seedlings (2-years-old) treated with 1-24-2 CFs + pine wood nematode (T2) showed a significant control effect of 80%. A total of 24 toxic compounds were first identified from 1-24-2 CFs through gas chromatography-mass spectrometry (GC-MS) analysis, from which O-methylisourea, 2-chlorobenzothiazole, and 4,5,6-trihydroxy-7-methylphthalide showed robust binding sites at Tyr119 against phosphoethanolamine methyltransferase (PMT) protein of Bursaphelenchus xylophilus by molecular docking approach and could be used as potential compounds for developing effective nematicides. Interestingly, strain 1-24-2 produces toxic volatile organic compounds (VOCs), which disturb the natural development process of B. xylophilus, whose total number decreased by up to 83.32% in the treatment group as compared to control and also reduced Botrytis cinerea growth by up to 71.01%. Our results highlight the potential of C. ascotrichoides 1-24-2 as a promising biocontrol agent with solid nematicidal activity against B. xylophilus. This is the first report of C. ascotrichoides isolated from P. massoniana exhibiting strong biocontrol potential against B. xylophilus in the world. © 2024 Society of Chemical Industry.