Fire blight, a devastating disease caused by Erwinia amylovora, poses a significant threat to pear and apple trees in Xinjiang province, China. In an effort to combat this pathogen, we isolated 10 bacteria from various components of apple and crabapple trees and conducted screenings to assess their ability to inhibit E. amylovora in vitro. Through biochemical tests and partial 16S rRNA gene sequencing, we identified two promising strains, Priestia megaterium strain H1 and Bacillus subtilis strain I2. These strains were then evaluated for their efficacy in biocontrol under controlled laboratory conditions, focusing on immature fruits and leaves. Remarkably, all selected antagonists exhibited the capability to reduce the severity of the disease on both fruit and leaves. P. megaterium strain H1 and B. subtilis strain I2 exhibited significant reductions in disease incidence on both immature fruits and leaves compared to the control. Specifically, on immature fruits, they achieved reductions of 53.39% and 44.76%, respectively, while on leaves, they demonstrated reductions of 59.55% and 55.53%, respectively. Furthermore, during the study, we detected the presence of lipopeptides, including surfactin, iturins, bacillomycin D, and fengycins, in the methanol extract obtained from these two antagonistic bacteria using thin-layer chromatography (TLC). Based on the results obtained, B. subtilis strain I2 and P. megaterium strain H1 exhibit considerable potential for controlling fire blight. However, further evaluation of their efficacy under natural field conditions is essential to validate their practicality as a biocontrol method.