Endophytes associated with halophytes may contribute to the host’s adaptation to adverse environmental conditions through improving their stress tolerance and protecting them from various soil-borne pathogens. In this study, the diversity and antifungal activity of endophytic bacteria associated with halophytic samples growing on the shore of the western Aral Sea in Uzbekistan were investigated. The endophytic bacteria were isolated from the nine halophytic samples by using the culture-dependent method and identified according to their 16S rRNA gene sequences. The screening of endophytic bacterial isolates with the ability to inhibit pathogenic fungi was completed by the plate confrontation method. A total of 289 endophytic bacterial isolates were isolated from the nine halophytes, and they belong to Firmicutes, Actinobacteria, and Proteobacteria. The predominant genera of the isolated endophytic bacteria were Bacillus, Staphylococcus, and Streptomyces, accounting for 38.5%, 24.7%, and 12.5% of the total number of isolates, respectively. The comparative analysis indicated that the isolation effect was better for the sample S8, with the highest diversity and richness indices. The diversity index of the sample S7 was the lowest, while the richness index of samples S5 and S6 was the lowest. By comparing the isolation effect of 12 different media, it was found that the M7 medium had the best performance for isolating endophytic bacteria associated with halophytes in the western Aral Sea Basin. In addition, the results showed that only a few isolates have the ability to produce ex-enzymes, and eight and four endophytic bacterial isolates exhibited significant inhibition to the growth of Valsa mali and Verticillium dahlia, respectively. The results of this study indicated that halophytes are an important source for the selection of microbes that may protect plant from soil-borne pathogens.