The placenta is a barrier against maternal-fetal transmission of pathogens. Placental infections can cause several adverse pregnancy outcomes, including preterm birth (PTB). Yet, we have limited knowledge regarding the mechanisms the placenta uses to control infections. Here, we show that autophagy, a cellular recycling pathway important for host defense against pathogens, and the autophagy gene Atg16L1 play a key role in placental defense and are negatively associated with PTB in pregnant women. First, we demonstrate that placentas from women who delivered preterm exhibit reduced autophagy activity and are associated with higher infection indicators. Second, we identify the cellular location of the autophagy activity as being in syncytial trophoblasts. Third, we demonstrate that higher levels of autophagy and ATG16L1 in human trophoblasts were associated with increased resistance to infection. Accordingly, loss of autophagy or ATG16L1 impaired trophoblast antibacterial defenses. Fourth, we show that Atg16l1-deficient mice gave birth prematurely upon an inflammatory stimulus and their placentas were significantly less able to withstand infection. Finally, global induction of autophagy in both mouse placentas and human trophoblasts increased infection resistance. Our study has significant implications for understanding the etiology of placental infections and prematurity and developing strategies to mitigate placental infection–induced PTB.