To examine whether prenatal exposure to maternal bereavement is associated with an increased risk of epilepsy in the first decades of life.We conducted a population-based cohort study of children (N=1,553,966) born in Denmark from 1978 to 2004. A total of 39,867 children born to women who lost a close relative while pregnant or within 1 year before the pregnancy were included in the exposed cohort. The main outcome of interest was hospitalization due to epilepsy (ICD 8 codes 345.00–345.99, ICD 10 codes G40.0–G41.9). We used log-linear Poisson models to estimate incidence rate ratios (IRRs).The exposed children had a risk of epilepsy similar to that of unexposed children (IRR 1.06, 95% CI 0.96–1.18). The IRRs were 1.08 (95% CI 0.89–1.31) for the children of women who lost a child, and 1.02 (95% CI 0.91–1.15) for the children of women who lost a partner, parent or sibling. The IRRs did not differ according to the timing of exposure or the causes of death (unexpected causes and other causes).Our data do not suggest any strong association between prenatal stress and epilepsy in the first decades of life.