Aspergillus flavus has evoked worldwide attention owing to its serious threat to public health, but how to safely, efficiently, and economically reduce A. flavus contamination remains a great challenge. Here, a Bacillus strain capable of inhibiting A. flavus was isolated from lichens. The antifungal assay showed that Bacillus velezensis YE-1 could inhibit the growth of A. flavus. Scanning and transmission electron microscopy revealed that B. velezensis YE-1 exposure severely deformed the spore and mycelial structure and morphology of A. flavus. Furthermore, the biochemical studies revealed a significant alternation in ergosterol content, mitochondrial membrane potential, nuclear DNA, and aflatoxin synthesis gene in A. flavus exposed to B. velezensis YE-1. In addition, the inhibitory activity of isolated B. velezensis YE-1 was mainly present in the cell-free supernatant, confirming that the heat-resistant non-protein substances produced by B. velezensis YE-1 exerted an antagonistic role on A. flavus. Finally, on corn and peanut kernels, B. velezensis YE-1 can also remarkably improve the disease severity by A. flavus. Therefore, our results showed that B. velezensis YE-1 could be a very promising biocontrol agent for A. flavus and subsequent contamination of food/feed commodities.