Preterm birth (PTB) is a leading cause of neonatal death worldwide. Intrauterine and systemic infection and inflammation cause 30-40% of spontaneous preterm labor (PTL), which precedes PTB. Although antibody production is a major immune defense mechanism against infection, and B cell dysfunction has been implicated in pregnancy complications associated with PTL, the functions of B cells in pregnancy are not well known. We found that choriodecidua of women undergoing spontaneous PTL harbored functionally altered B cell populations. B cell-deficient mice were markedly more susceptible than wild-type (WT) mice to PTL after inflammation, but B cells conferred interleukin (IL)-10-independent protection against PTL. B cell deficiency in mice resulted in a lower uterine level of active progesterone-induced blocking factor 1 (PIBF1), and therapeutic administration of PIBF1 mitigated PTL and uterine inflammation in B cell-deficient mice. B cells are a significant producer of PIBF1 in human choriodecidua and mouse uterus in late gestation. PIBF1 expression by B cells is induced by the mucosal alarmin IL-33 (ref. 9). Human PTL was associated with diminished expression of the α-chain of IL-33 receptor on choriodecidual B cells and a lower level of active PIBF1 in late gestation choriodecidua. These results define a vital regulatory cascade involving IL-33, decidual B cells and PIBF1 in safeguarding term pregnancy and suggest new therapeutic approaches based on IL-33 and PIBF1 to prevent human PTL.