Regulatory B cells (Breg cells) differentiate in response to inflammation and subsequently restrain excessive immune responses via the release of interleukin-10 (IL-10). However, the precise inflammatory signals governing their differentiation remain to be elucidated. Here we show that the gut microbiota promotes the differentiation of Breg cells in the spleen as well as in the mesenteric lymph nodes. Perturbation of the gut microbiome imposed either by antibiotic treatment or by changes in the sterility of housing conditions reduces the number and function of Breg cells. Following the induction of arthritis, IL-1β and IL-6 are produced only in conventionally housed mice and both cytokines directly promote Breg cell differentiation and IL-10 production. Mice lacking IL-6 receptor (IL-6R) or IL-1 receptor 1 (IL-1R1) specifically on B cells have a reduced number of IL-10-producing B cells and develop exacerbated arthritis compared to control animals. Thus, in response to inflammatory signals induced by both the gut flora and arthritis, Breg cells increase in number and restrain excessive inflammation.