This paper proposes that the mammalian immune response known as "allergy" evolved as a last line of defense against the extensive array of toxic substances that exist in the environment in the form of secondary plant compounds and venoms. Whereas nonimmunological defenses typically can target only classes of toxins, the immune system is uniquely capable of the fine-tuning required to target selectively the specific molecular configurations of individual toxins. Toxic substances are commonly allergenic. The pharmacological chemicals released by the body's mast cells during an IgE antibody-mediated allergic response typically cause vomiting diarrhea, coughing, tearing, sneezing, or scratching, which help to expel from the body the toxic substance that triggered the response; individuals frequently develop aversions to substances that have triggered such responses. A strong allergic response often includes a decrease in blood pressure, which slows the rate at which toxins circulate to target organs. The immune system identifies as toxic the following kinds of substances: (1) those low-molecular-weight substances that bind covalently to serum proteins (e.g., many plant toxins); (2) nontoxic proteins that act as carriers of toxins with low molecular weights (e.g., plant proteins associated with plant toxins); (3) specific substances of high molecular weight that harmed individuals in ancestral mammalian populations for a span of time that was significant from the standpoint of natural selection (e.g., the toxic proteins of bee venom. Substances that bind covalently to serum proteins generally are acutely toxic, and because many of these substances also bind covalently to the DNA of target cells, they are potentially mutagenic and carcinogenic as well. Thus, by protecting against acute toxicity, allergy may also defend against mutagens and carcinogens. The toxic hypothesis explains the main phenomena of allergy; why IgE-mediated allergies usually occur within minutes of exposure to an allergen and why they are often so severe; why the manifestations of allergy include vomiting, diarrhea, coughing, sneezing, scratching, tearing, and a drop in blood pressure; why covalent binding of low-molecular-weight substances to serum proteins frequently causes allergy; why allergies occur to many foods, pollens, venoms, metals, and drugs; why allergic cross-reactivity occurs to foods and pollen from unrelated botanical families; why allergy appears to be so capricious and variable; and why allergy is more prevalent in industrial societies than it is in foraging societies. This hypothesis also has implications for the diagnosis, prevention, and treatment of allergy.