Importance Maternal antenatal corticosteroid treatment is standard care to accelerate fetal maturation when birth before 34 weeks is imminent. Recently, expansion of the indications beyond 34 gestational weeks has been debated. However, data about long-term outcomes remain limited, especially among infants who after treatment exposure are born at term. Objective To study if antenatal corticosteroid treatment is associated with mental and behavioral disorders in children born at term (≥37 weeks 0 days’ gestation) and preterm ( Design, Setting, and Participants Population-based retrospective cohort study using nationwide registries of all singleton live births in Finland surviving until 1 year and a within-sibpair comparison among term siblings. Children were born between January 1, 2006, and December 31, 2017, and followed up until December 31, 2017. Exposures Maternal antenatal corticosteroid treatment. Main Outcomes and Measures Primary outcome was any childhood mental and behavioral disorder diagnosed in public specialized medical care settings. Results Of the 674 877 singleton children born in Finland during the study period, 670 097 were eligible for analysis. The median length of follow-up was 5.8 (interquartile-range, 3.1-8.7) years. Of the 14 868 (2.22%; 46.1% female) corticosteroid treatment–exposed children, 6730 (45.27%) were born at term and 8138 (54.74%) were born preterm; of the 655 229 (97.78%; 48.9% female) nonexposed children, 634 757 (96.88%) were born at term and 20 472 (3.12%) were born preterm. Among the 241 621 eligible term-born maternal sibpairs nested within this population, 4128 (1.71%) pairs were discordant for treatment exposure. Treatment exposure, compared with nonexposure, was significantly associated with higher risk of any mental and behavioral disorder in the entire cohort of children (12.01% vs 6.45%; absolute difference, 5.56% [95% CI, 5.04%-6.19%]; adjusted hazard ratio [HR], 1.33 [95% CI, 1.26-1.41]), in term-born children (8.89% vs 6.31%; absolute difference, 2.58% [95% CI, 1.92%-3.29%]; HR, 1.47 [95% CI, 1.36-1.69]), and when sibpairs discordant for treatment exposure were compared with sibpairs concordant for nonexposure (6.56% vs 4.17% for within-sibpair differences; absolute difference, 2.40% [95% CI, 1.67%-3.21%]; HR, 1.38 [95% CI, 1.21-1.58]). In preterm-born children, the cumulative incidence rate of any mental and behavioral disorder was also significantly higher for the treatment-exposed compared with the nonexposed children, but the HR was not significant (14.59% vs 10.71%; absolute difference, 3.38% [95% CI, 2.95%-4.87%]; HR, 1.00 [95% CI, 0.92-1.09]). Conclusions and Relevance In this population-based cohort study, exposure to maternal antenatal corticosteroid treatment was significantly associated with mental and behavioral disorders in children. These findings may help inform decisions about maternal antenatal corticosteroid treatment.