Short-chain fatty acids (SCFAs) have immunomodulatory effects, but the underlying mechanisms are not well understood. Here we show that pentanoate, a physiologically abundant SCFA, is a potent regulator of immunometabolism. Pentanoate induces IL-10 production in lymphocytes by reprogramming their metabolic activity towards elevated glucose oxidation. Mechanistically, this reprogramming is mediated by supplying additional pentanoate-originated acetyl-CoA for histone acetyltransferases, and by pentanoate-triggered enhancement of mTOR activity. In experimental mouse models of colitis and multiple sclerosis, pentanoate-induced regulatory B cells mediate protection from autoimmune pathology. Additionally, pentanoate shows a potent histone deacetylase-inhibitory activity in CD4+ T cells, thereby reducing their IL-17A production. In germ-free mice mono-colonized with segmented filamentous bacteria (SFB), pentanoate inhibits the generation of small-intestinal Th17 cells and ameliorates SFB-promoted inflammation in the central nervous system. Taken together, by enhancing IL-10 production and suppressing Th17 cells, the SCFA pentanoate might be of therapeutic relevance for inflammatory and autoimmune diseases.