Bacterial metabolites exhibit a variety of biologically active compounds including antibacterial and antifungal activities. It is well known that Bacillus is considered to be a promising source of bioactive secondary metabolites. Most plant pathogens have an incredible ability to mutate and acquire resistance, causing major economic losses in the agricultural field. Therefore, it is necessary to use the natural antibacterial compounds in microbes to control plant pathogens. This study was conducted to investigate the bio-active compounds of Bacillus megaterium L2. According to the activity guidance of Agrobacterium tumefaciens T-37, Erwinia carotovora EC-1 and Ralstonia solanacearum RS-2, five monomeric compounds, including erucamide (1), behenic acid (2), palmitic acid (3), phenylacetic acid (4), and β-sitosterol (5), were fractionated and purified from the crude ethyl acetate extract of B. megaterium. To our knowledge, all compounds were isolated from the bacterium for the first time. To understand the antimicrobial activity of these compounds, and their minimum inhibitory concentrations (MICs) (range: 0.98∼500 μg/mL) were determined by the broth microdilution method. For the three tested pathogens, palmitic acid exhibited almost no antibacterial activity (>500 μg/mL), while erucamide had moderate antibacterial activity (MIC = 500 μg/mL). Behenic acid showed MICs of 250 μg/mL against T-37 and RS-2 strains with an antibacterial activity. β-sitosterol showed significant antimicrobial activity against RS-2. β-sitosterol showed remarkable antimicrobial activity against RS-2 with an MIC of 15.6 μg/mL. In addition, with the antimicrobial activity, against T-37 (62.5 μg/mL) and against EC-1 (125 μg/mL) and RS-2 (15.6 μg/mL) strains notably, phenylacetic acid may be interesting for the prevention and control of phytopathogenic bacteria. Our findings suggest that isolated compounds such as behenic acid, β-sitosterol, and phenylacetic acid may be promising candidates for natural antimicrobial agents.