Pre-harvest infection of groundnut (Arachis hypogea) during drought stress by strains of Aspergillus flavus and Aspergillus parasiticus is a major health and food safety concern worldwide. The fungi release aflatoxins, which are carcinogenic and hepatotoxic at levels of parts per billion. In this study, a formulated biocontrol agent, Trichoderma harzianum strain kd (Tkd), was used to control Aspergillus flavus infection of groundnut in the field. Groundnut seeds treated with Tkd developed more root biomass than the control (untreated with Tkd). Growth of Trichoderma mycelium from sterilized roots of groundnuts grown on Trichoderma selective media indicates root colonization of the intercellular spaces in groundnut roots by Tkd. Even the control plants showed evidence of root colonization by Trichoderma but at much lower levels. This shows that groundnuts are particularly a compatible host of Trichoderma acting as an endophyte. Under scanning electron microscopy, T. harzianum showed the ability to parasitize A. flavus by coiling around A. flavus hyphae, penetrating and degrading the mycelium of A. flavus. The levels of aflatoxin B1 contamination from Aspergillus infection were determined using a MaxiSignal® ELISA test kit. The aflatoxin levels of A. flavus-inoculated control plants were significantly (p < 0.001) higher than that of the Tkd-treated plants, by 57 and 65%, in two trials. Yields from plants treated with Tkd were 35 and 49% higher than that from the control (untreated with Tkd) plants in these field trials. It can be concluded that application of Tkd to groundnut seeds may reduce infection of the groundnut seeds by Aspergillus flavus, and hence, it may reduce the contamination of the seed by aflatoxin, especially under drought stress condition. Concurrently, Tkd treatment may result in yields being enhanced by more than 35%.