Pore-forming toxins (PFTs) are bacterial toxins that form holes at the plasma membrane of cells and play an important role in the pathogenesis of many important human pathogens. Although PFTs comprise an important and the single largest class of bacterial protein virulence factors, how cells respond to these toxins has been understudied. We describe here the surprising discovery that a fundamental pathway of eukaryotic cell biology, the endoplasmic reticulum unfolded protein response (UPR), is activated by pore-forming toxins in Caenorhabditis elegans and mammalian cells. We find that this activation is functionally important since loss of either of two of the three arms of UPR leads to hypersensitivity of the nematode to attack by PFTs. The response of the UPR to PFTs can be separated from its response to unfolded proteins both at the level of activation and functional relevance. The response of the UPR to PFTs is dependent on a central pathway of cellular immunity, the p38 MAPK pathway. Our data show that the response of cells to bacterial attack can reveal unanticipated uses and connections between fundamental cell biological pathways.