Severe prenatal stress exposure has been found to increase the risk of neuropsychiatric conditions like schizophrenia. We examined the risk of attention-deficit/hyperactivity disorder (ADHD) in the offspring following prenatal maternal bereavement, as a potential source of stress exposure. We conducted a nationwide population-based cohort study including all 1,015,912 singletons born in Denmark from 1987 to 2001. A total of 29,094 children were born to women who lost a close relative during pregnancy or up to 1 year before pregnancy. These children were included in the exposed cohort and other children were in the unexposed cohort. We used Cox regression to estimate hazard ratios for ADHD, defined as the first-time ADHD hospitalization or first-time ADHD medication after 3 years of age. Boys born to mothers who were bereaved by unexpected death of a child or a spouse, had a 72% increased risk of ADHD [hazard ratio (HR) 1.72, 95% confidence interval (CI) 1.09–2.73]. Boys born to mothers who lost a child or a spouse during 0–6 months before pregnancy and during pregnancy had a HR of 1.47 (95% CI 1.00–2.16) and 2.10 (95% CI 1.16–3.80), respectively. Our findings suggest that prenatal maternal exposure to severe stress may increase the risk of ADHD in the offspring.