Pitaya canker, caused by Neoscytalidium dimidiatum, is one of the most important fungal diseases that cause significant losses in production. To replace chemical pesticides, the use of biocontrol strains to manage plant diseases has been the focus of research. In this study, the bacterial strain AF01, identified as Paenibacillus polymyxa, exhibited significant antifungal effects against N. dimidiatum and four other pitaya fungal pathogens. The strain P. polymyxa AF01 produces 13 fusaricidins, which directly inhibit mycelial growth, spore germination and germ tube elongation by causing the membrane integrity and cell ultrastructure to incur irreversible damage. Pot experiment and yield test confirmed that AF01 provided preservative effects by reducing the disease index. In comparison to the untreated control groups, RNA-seq data showed that P. polymyxa AF01 selectively blocked some transcription and translation processes and inhibited RNA and DNA structural dynamics, energy production and conversion, and signal transduction, particularly cell wall biosynthesis, changes in membrane permeability, and impairment of protein biosynthesis. Thus, P. polymyxa AF01 could be potentially useful as a suitable biocontrol agent for pitaya canker.