IgE is an ancient and conserved immunoglobulin isotype with potent immunological function. Nevertheless, the regulation of IgE responses remains an enigma, and evidence of a role for IgE in host defense is limited. Here we report that topical exposure to a common environmental DNA-damaging xenobiotic initiated stress surveillance by γδTCR+ intraepithelial lymphocytes that resulted in class switching to IgE in B cells and the accumulation of autoreactive IgE. High-throughput antibody sequencing revealed that γδ T cells shaped the IgE repertoire by supporting specific variable-diversity-joining (VDJ) rearrangements with unique characteristics of the complementarity-determining region CDRH3. This endogenous IgE response, via the IgE receptor FcεRI, provided protection against epithelial carcinogenesis, and expression of the gene encoding FcεRI in human squamouscell carcinoma correlated with good disease prognosis. These data indicate a joint role for immunosurveillance by T cells and by B cells in epithelial tissues and suggest that IgE is part of the host defense against epithelial damage and tumor development.