Aflatoxins (AFs) are a group of carcinogenic and immunosuppressive fungal toxins that threaten global food safety. Over 4.5 billion people are exposed to high, unmonitored levels of AFs. Among AFs, aflatoxin B1 (AFB1) produced mainly by Aspergillus flavus is the most potent carcinogen found in nature. One approach reducing levels of AFs in agricultural commodities is applying a non-aflatoxigenic competitor, e.g., Afla-Guard® in fields. In this study, we demonstrate that the food grade fungus Aspergillus oryzae M2040, isolated from the soy brick Meju, can inhibit AFB1 production and proliferation of toxigenic A. flavus in lab culture and peanuts. In peanuts, M2040 could effectively displace the toxigenic A. flavus and inhibit AFB1 production even at 1% inoculation level. Moreover, cell-free culture filtrate of A. oryzae M2040 effectively inhibited AFB1 production and A. flavus growth, suggesting the secretion of inhibitory compounds into the medium. Whole genome sequencing and comparative analyses indicate that the A. oryzae M2040 and Afla-Guard® genomes are 37.9 and 36.4 Mbp, of which contains 100 lineage specific genes, respectively. Our studies systematically illuminate the idea of the potential use of A. oryzae and its cell-free culture fermentate as a potent biocontrol agent to control A. flavus propagation and AF contamination.