Intestinal Paneth cells limit bacterial invasion by secreting antimicrobial proteins, including lysozyme. However, invasive pathogens can disrupt the Golgi apparatus, interfering with secretion and compromising intestinal antimicrobial defense. Here we show that during bacterial infection, lysozyme is rerouted via secretory autophagy, an autophagy-based alternative secretion pathway. Secretory autophagy was triggered in Paneth cells by bacteria-induced endoplasmic reticulum (ER) stress, required extrinsic signals from innate lymphoid cells, and limited bacterial dissemination. Secretory autophagy was disrupted in Paneth cells of mice harboring a mutation in autophagy gene Atg16L1 that confers increased risk for Crohn’s disease in humans. Our findings identify a role for secretory autophagy in intestinal defense and suggest why Crohn’s disease is associated with genetic mutations that affect both the ER stress response and autophagy.