Aspergillus flavus and the produced aflatoxins cause great damage to crop production, food security, and human health. The control of A. flavus and aflatoxins in the grains during storage is a great challenge to humans worldwide. In this study, we investigated the potential of the strain TR-18, isolated from the rhizosphere of tea plants, in controlling A. flavus and aflatoxins. The results demonstrated that TR-18 greatly inhibited A. flavus growth in dual cultural tests by the production of antifungal volatiles. TR-18 was identified as Flavobacterium johnsoniae through biochemical analysis and a 16S rRNA phylogenetic tree. Moreover, TR-18 effectively inhibited A. flavus growth and aflatoxin production in peanuts during storage. Further analysis of TR-18’s volatiles was conducted by gas chromatography–tandem mass spectrometry. Five authentic compounds were identified in the volatiles of TR-18: methyl thiolacetate, dimethyl disulfide (DMDS), methyl isovalerate, 5-methyl-3-hexanone, and S-methyl 3-methylbutanethioate. DMDS with a relative content of 54.92% (peak area normalization) was the most abundant compound in the volatiles. The minimal inhibitory concentration of DMDS against A. flavus growth was 50 μl/liter (compound volume/airspace volume). The other compounds also showed a great inhibition rate (more than 90%) to A. flavus at 200 μl/liter. In addition, TR-18 exhibited broad antifungal activity against other six important phytopathogens, that is, Fusarium graminearum, F. verticillioides, Colletotrichum graminicola, C. fructicola, Alternaria alternata, and Botrytis cinerea, with inhibition rates ranging from 52.90 to 98.70%. In conclusion, F. johnsoniae TR-18 with the production of five types of antifungal volatiles could be used as potential biocontrol agents in controlling pathogenic fungi and associated mycotoxins in the grains during storage.