Mucosal-associated invariant T lymphocytes (MAIT lymphocytes) are characterized by two evolutionarily conserved features: an invariant T cell antigen receptor (TCR) alpha-chain and restriction by the major histocompatibility complex (MHC)-related protein MR1. Here we show that MAIT cells were activated by cells infected with various strains of bacteria and yeast, but not cells infected with virus, in both humans and mice. This activation required cognate interaction between the invariant TCR and MR1, which can present a bacteria-derived ligand. In humans, we observed considerably fewer MAIT cells in blood from patients with bacterial infections such as tuberculosis. In the mouse, MAIT cells protected against infection by Mycobacterium abscessus or Escherichia coli. Thus, MAIT cells are evolutionarily conserved innate-like lymphocytes that sense and help fight off microbial infection.