Although placental mammals are at high risk of maternal-fetal immune conflict, it is unclear how the semi-allogeneic fetus avoids rejection. Cholesterol sulfate (CS) is a bioactive metabolite that inhibits leukocyte migration and activation. This study investigated the roles and cells associated with CS in pregnant mice and humans. CS was sequentially produced by maternal-derived endometrial cells and fetal-derived placental trophoblasts before and after placentation. When mated with allogeneic males, CS-deficient mice showed increased fetal resorption rates under induced placental inflammation. This phenotype disappeared when the activity of the CS-producing enzyme was restored in the placenta. Placental CS levels were reduced in patients with "villitis of unknown etiology." Thus, we uncovered the spatiotemporal control of CS production and its relevance to local immunosuppression during pregnancy.