Maternal prenatal depression and anxiety (PDA) have been associated with increased risks of adverse birth and neurodevelopmental outcomes in children. While fetal exposure to too high or low levels of steroid hormones has been proposed as a potential biological mechanism underlying these effects, few studies have directly investigated this hypothesis using fetal tissue samples, and the existing studies have been limited to examining cortisol, cortisone or testosterone. We studied associations between PDA and steroid hormones in amniotic fluid by measuring a panel of 17 steroid hormones - including progestogens, mineralocorticoids, glucocorticoids, androgens and estrogens - and their substrate-to-product ratios in 173 women with singleton pregnancies undergoing amniocentesis during second trimester. The fetuses had no chromosomal abnormalities. We defined any PDA as meeting at least one of the following criteria: reported symptoms above clinical cut off (CES-D ≥ 20 or STAI state or trait anxiety ≥ 40) during pregnancy, lifetime diagnosis (ICD-10 codes F31-33, F41-43), and/or lifetime medication purchases (ATC-codes N06A, N05B). Elastic net regression identified two glucocorticoid metabolites, 20α-dihydrocortisol and 5β-tetrahydrocortisol, with lower amniotic fluid levels in fetuses of mothers with PDA compared to those without PDA (unadjusted mean difference -0.37 SD units, 95 % CI: [-0.68, -0.07]; and -0.40 SD units, 95 % CI: [-0.70, -0.10], respectively). The model with both steroids remained significant after adjusting for maternal age, body mass index, education, smoking during pregnancy, parity, gestational age at amniocentesis and fetal sex, and in sensitivity analyses excluding mothers with diabetes and hypertensive disorders (p-values < .05) and was not moderated by fetal sex (p-value > .40). PDA was not significantly associated with any substrate-to-product ratios of the steroids, used as proxies of steroid hormone metabolizing enzymes, after correction for multiple testing. This study provides support for the prenatal programming hypothesis of PDA influencing fetal environment through suboptimal levels of steroid hormones and highlights the need to expand to a comprehensive panel of steroid metabolism.