Walnut blight caused by Xanthomonas arboricola pv. juglandis (Xaj) is an important bacterial disease for walnut production worldwide. The objective of the present study was to characterize one endophytic bacterium, namely OFE17 from Osmanthus fragrans leaves, evaluate its potential biocontrol efficiency against the disease, and identify the probable underlying mechanisms of its function. Based on morphology, biochemical and physiological characteristics, 16S-rDNA and gyrB sequences, and antibiotic production genes, the endophyte OFE17 was tentatively identified as Bacillus sp. A disease control efficiency of up to 68.69% was observed through a biocontrol test on detached immature walnut fruits under controlled conditions. OFE17 can produce protease, cellulase, amylase, siderophores, and demonstrates phosphate dissolving ability.However, OFE17 is unable to produce extracellular lipase, IAA (indoleacetic acid), and has no nitrogen fixation capability. The active compounds of OFE17 were composed primarily non-protein compounds, and the optimum organic extraction solvent was chloroform. Through specific PCR detection, we discovered it contains the genes ituA and ituD which play a key role in active compound synthesis of iturin A synthetase. This study added a promising biocontrol agent candidate for the disease control and laid a foundation for further exploration.