ImportancePrenatal antiseizure medication (ASM) exposure has been associated with adverse early neurodevelopment, but associations with a wider range of psychiatric end points have not been studied.ObjectiveTo examine the association between prenatal exposure to ASM with a spectrum of psychiatric disorders in childhood and adolescence in children of mothers with epilepsy.Design, Setting, and ParticipantsThis prospective, population-based register study assessed 4 546 605 singleton children born alive in Denmark, Finland, Iceland, Norway, and Sweden from January 1, 1996, to December 31, 2017. Of the 4 546 605 children, 54 953 with chromosomal disorders or uncertain birth characteristics were excluded, and 38 661 children of mothers with epilepsy were identified. Data analysis was performed from August 2021 to January 2023.ExposuresPrenatal exposure to ASM was defined as maternal prescription fills from 30 days before the first day of the last menstrual period until birth.Main Outcomes and MeasuresThe main outcome measure was diagnosis of psychiatric disorders (a combined end point and 13 individual disorders). Estimated adjusted hazard ratios (aHRs) using Cox proportional hazards regression and cumulative incidences with 95% CIs are reported.ResultsAmong the 38 661 children of mothers with epilepsy (16 458 [42.6%] exposed to ASM; 19 582 [51.3%] male; mean [SD] age at the end of study, 7.5 [4.6] years), prenatal valproate exposure was associated with an increased risk of the combined psychiatric end point (aHR, 1.80 [95% CI, 1.60-2.03]; cumulative risk at 18 years in ASM-exposed children, 42.1% [95% CI, 38.2%-45.8%]; cumulative risk at 18 years in unexposed children, 31.3% [95% CI, 28.9%-33.6%]), which was driven mainly by disorders within the neurodevelopmental spectrum. Prenatal exposure to lamotrigine, carbamazepine, and oxcarbazepine was not associated with an increased risk of psychiatric disorders, whereas associations were found for prenatal exposure to topiramate with attention-deficit/hyperactivity disorder (aHR, 2.38; 95% CI, 1.40-4.06) and exposure to levetiracetam with anxiety (aHR, 2.17; 95% CI, 1.26-3.72) and attention-deficit/hyperactivity disorder (aHR, 1.78; 95% CI, 1.03-3.07).Conclusions and RelevanceFindings from this explorative study strengthen the evidence for the warning against the use of valproate in pregnancy and raise concern of risks of specific psychiatric disorders associated with topiramate and levetiracetam. This study provides reassuring evidence that lamotrigine, carbamazepine, and oxcarbazepine are not associated with long-term behavioral or developmental disorders but cannot rule out risks with higher doses.