OBJECTIVE: Prenatal opioid exposure has been linked with impaired cognitive development, with boys potentially at elevated risk. In the present study, we examined cognitive and language development of children prenatally exposed to opioids, with an additional focus on sex differences. METHODS: A sample of 378 children (n = 194 girls and n = 184 boys) aged 1.2-42.8 months was drawn from the Danish Family Outpatient Clinic database. Developmental outcomes were assessed using the Bayley-III cognitive and language scales, and substance exposure was determined with urine screening and/or verbal report. Children exposed to opioids (n = 94) were compared to children with no prenatal substance exposure (n = 38), and children exposed to alcohol (n = 131) or tobacco (n = 115). Group and sex differences were investigated with separate linear mixed models for each Bayley scale, controlling for concurrent cannabis exposure. RESULTS: There were significantly reduced scores in opioid-exposed boys compared to boys with no prenatal substance exposure, but no difference between opioid-exposed and nonexposed girls. Additionally, alcohol-exposed boys had lower cognitive scores than nonexposed boys, and alcohol-exposed girls had lower scores on both scales compared to opioid-exposed girls. There were otherwise no significant differences according to group, sex, or scale. CONCLUSIONS: The present findings indicate poorer cognitive and language development in boys after prenatal opioid exposure. As academic performance is rooted in cognitive functioning, long-term follow-up might be necessary for exposed children.