Variations in moisture and substrate in preharvest corn kernels and cottonseed were linked with the ability of Aspergillus parasiticus to infect the seed and produce aflatoxin. Osmotic pressures and moisture content (MC) levels of developing starch-rich corn kernels and lipid-rich cottonseed were determined. For in vivo studies, corn kernels and cottonseed were inoculated with A. parasiticus conidia and retained on plants through maturation. For in vitro studies, samples of corn kernels and cottonseed were collected at various stages, sterilized, inoculated, incubated for 2 weeks, and assayed for toxin. Aflatoxin levels were highest in corn kernels inoculated at 28 days postflowering (52% MC) in both the in vivo and in vitro tests. Toxin concentrations in cottonseed were greatest with inoculation at 35 days postflowering (70% MC) in seed retained on the plant, but toxin accumulation continued to increase with the maturity of the seed inoculated in cottonseed used in the in vitro trials. Moisture and substrate conditions in the midrange of seed development provided optimum conditions for fungal development and toxin production in seed retained on the plant.