Context: Intrauterine inflammation, a representative stressor for the fetus, has been shown to alter the hypothalamus–pituitary–adrenal (HPA) axis reactivity in preterm fetuses and increase postnatal cortisol production. However, the mechanism of this alteration has not yet been elucidated. Objective: We aimed to clarify the effects of endotoxin-induced intrauterine inflammation on the HPA axis of periviable sheep fetuses. Methods: Fetal sheep (0.63 term) were divided into 2 groups: (1) the endotoxin group, in which the endotoxin was injected into the amniotic fluid; and (2) the control group, in which the saline solution was injected instead. A corticotropin-releasing hormone (CRH) challenge test was performed on the third day after injection to evaluate the cortisol-producing capacity of each group. Gene expression levels in the fetal adrenal glands of each group were analyzed by RNA-seq. Results: The cortisol levels were significantly higher in the endotoxin group than in the control group after CRH challenge (P = .02). There were no significant differences in the responsiveness of adrenocorticotropin and cortisone between the 2 groups. Gene expression levels of the following enzymes involved in cortisol synthesis were significantly elevated in the endotoxin group: cytochrome P450 family (CYP) 11 subfamily A member 1 (log2FC 1.75), CYP 17 subfamily A member 1 (log2FC 3.41), 3β-hydroxysteroid dehydrogenase type I (log2FC 1.13), steroidogenic acute regulatory protein (log2FC 1.09), and CYP 21 (log2FC 0.89). Conclusion: Periviable fetuses exposed to inflammation in utero have altered the responsiveness of the HPA axis with increased expression of enzymes involved in cortisol synthesis in the adrenal gland.