Application of insecticides for pest control must be minimized due to well-known risks to human health. Application of environmentally friendly means is the best option. For stored product pests' control, new means are needed alongside a deep understanding of the ecology and behavior of the pests. The present study investigated whether the odor released from wheat grain infected by mold fungus Aspergillus flavus (Eurotiales: Aspergillaceae) influences the behavior of the yellow mealworm (Tenebrio molitor L. (Coleoptera: Tenebrionidae)), a stored product pest of economic importance with worldwide distribution. Analysis of video-recorded behavior and computer data analysis revealed a significant difference in reactions depending on the beetle's sex. Females were more sensitive to fungus contamination as they discriminated between A. flavus-infected and uninfected wheat grains from the onset of infection, while males discriminated only after a 5-day period. Analysis of single volatile organic compounds (VOCs) revealed the presence of both repellents and attractants. Among those, hexanal was repellent for both males and females, 1-octen-3-ol was repellent for males and indifferent to females, 1-hexanol was attractive to females and repellent (at high concentrations only) to males, and 3-methylbutan-1-ol was attractive to females (at high concentrations only) and indifferent to males. Hexanal, as a potential repellent, was suggested for further testing under grain storage conditions.