The primary function of fruit is to attract animals that disperse viable seeds, but the nutritional rewards that attract beneficial consumers also attract consumers that kill seeds instead of dispersing them. Many of these unwanted consumers are microbes, and microbial defense is commonly invoked to explain the bitter, distasteful, occasionally toxic chemicals found in many ripe fruits. This explanation has been criticized, however, due to a lack of evidence that microbial consumers influence fruit chemistry in wild populations. In the present study, we use wild chilies to show that chemical defense of ripe fruit reflects variation in the risk of microbial attack. Capsaicinoids are the chemicals responsible for the well known pungency of chili fruits. Capsicum chacoense is naturally polymorphic for the production of capsaicinoids and displays geographic variation in the proportion of individual plants in a population that produce capsaicinoids. We show that this variation is directly linked to variation in the damage caused by a fungal pathogen of chili seeds. We find that Fusarium fungus is the primary cause of predispersal chili seed mortality, and we experimentally demonstrate that capsaicinoids protect chili seeds from Fusarium. Further, foraging by hemipteran insects facilitates the entry of Fusarium into fruits, and we show that variation in hemipteran foraging pressure among chili populations predicts the proportion of plants in a population producing capsaicinoids. These results suggest that the pungency in chilies may be an adaptive response to selection by a microbial pathogen, supporting the influence of microbial consumers on fruit chemistry. directed deterrence ͉ frugivory ͉ fruit chemistry ͉ secondary metabolite ͉ Capsicum chacoense T he evolution of fruit, a reward for animal dispersal of seeds, is a commonly cited example of a key innovation in the radiation of angiosperms (1-3). However, the nutritional qualities of fruit pulp that are responsible for attracting beneficial dispersers also attract consumers that are detrimental to plant fitness. These consumers range from vertebrate and invertebrate seed predators to microbial consumers of fruits and seeds that reduce the likelihood of dispersal and the viability of seeds (4). Fruit chemistry is commonly thought to mediate these interactions, either by deterring seed predators (4-6) or reducing microbial attack of fruits and seeds (4,7,8). These mechanisms are not mutually exclusive, but chemicals that deter fruit consumption often affect a wide range of species (7, 9), and defensive chemistry in ripe fruit must be sufficiently targeted toward detrimental organisms to allow consumption by vertebrate seed dispersers. Fruit secondary compounds that deter microbial consumers without reducing seed dispersal by vertebrates are thought to be far more plausible than secondary compounds that selectively deter vertebrate predators (7), because microbial fruit consumers are uniformly negative in their impacts on plant fitness (4) and are farther removed in...