Intestinal epithelial cells constitute a physical barrier which separates the immune cells from the abundant commensal bacteria present in the lumen and importantly modulate immune responses. Recent work highlighted these intestinal epithelial cells express Major Histocompatibility complex (MHC) II, which help in the activation of intestine-resident immune cells and maintain epithelial cell differentiation. The expression of epithelial MHC II is induced in response to inflammation and reported to be increased in inflammatory bowel disease (IBD), parasitic infections and with the introduction of bacteria in germ-free animals. However, no studies to date explore how epithelial cell-MHC II is regulated during homeostasis. Using animals lacking the Interleukin-22-receptor (IL-22RA1), primary human and murine intestinal and respiratory organoids and a murine model of infection (pneumovirus) or with epithelial cell defects (Muc2 missense mutation), we have discovered a novel role for IL-22 in suppressing epithelial cell MHC II via the regulation of endoplasmic reticulum (ER) stress. Animals lacking IL-22RA1 have ~3-fold higher epithelial cell MHC II on intestinal and respiratory epithelial cells. IL-22 directly downregulated Interferon-γ-induced MHC II on primary mucosal epithelial cells by modulating the expression of Class II transactivator (Ciita) which is a master control factor of MHC II. Using chemical-induced and spontaneous mouse models of IBD (colitis), we show that in non-infectious inflammatory disease IL-22-induced suppression of MHC II leads to an improvement in the paracellular barrier permeability, restoration of goblet cells and decreased inflammation. However, during acute mucosal infection, IL-22-mediated suppression of epithelial cell-MHC II leads to an aberrant immune response, suppression of cellular stress, increased mucus secretion, severe pathology, and increased mortality. Our work highlights the context dependent role of IL-22 and the potential implications for future IL-22-based therapeutics as 3 forms of long-circulating IL-22 are currently in clinical trials for different indications including inflammatory bowel disease.