Aspergilus flavus is the main pathogenic fungus that causes food mold. Effective control of A. flavus contamination is essential to ensure food safety. The lipopeptides (LPs) produced by Bacillus strains have been shown to have an obvious antifungal effect on molds. In this study, an antagonist strain of Bacillus velezensis with obvious antifungal activity against A. flavus was isolated from the surface of healthy rice. Using HPLC-MS analysis, the main components of LPs produced by strain E2 were identified as fengycin and iturins. Further investigations showed that LPs could inhibit the spore germination, and even cause abnormal expansion of hyphae and cell rupture. Transcriptomic analyses showed that some genes, involved in ribosome biogenesis in eukaryotes (NOG1, KRE33) and aflatoxin biosynthesis (aflK, aflR, veA, omtA) pathways in A. flavus were significantly down-regulated by LPs. In conclusion, this study provides novel insights into the cellular and molecular antifungal mechanisms of LPs against grain A. flavus contamination.