BACKGROUND AND AIM: Maternal infections during pregnancy have been associated with several neurological disorders in the offspring. However, given the lack of specificity for both the exposures and the outcomes, other factors related to infection such as impaired maternal immune function may be involved in the causal pathway. If impaired maternal immune function plays a role, we would expect infection before pregnancy to be associated with these neurological outcomes. METHODS/PRINCIPAL FINDINGS: The study population included all first-born singletons in Denmark between January 1 1982 and December 31 2004. We identified women who had hospital-recorded infections within the 5 year period before pregnancy, and women who had hospital-recorded infections during pregnancy. We grouped infections into either infections of the genitourinary system, or any other infections. Cox models were used to estimate adjusted hazard ratios (aHRs) with 95% confidence interval (CI). Maternal infection of the genitourinary system during pregnancy was associated with an increased risk of cerebral palsy (aHR = 1.63, 95% CI: 1.34-1.98) and epilepsy (aHR = 1.27, 95% CI: 1.13-1.42) in the children, compared to children of women without infections during pregnancy. Among women without hospital-recorded infections during pregnancy, maternal infection before pregnancy was associated with an increased risk of epilepsy (aHR = 1.35, 95% CI: 1.21-1.50 for infections of the genitourinary system, and HR = 1.12, 95% CI: 1.03-1.22 for any other infections) and a slightly higher risk of cerebral palsy (aHR = 1.20, 95% CI: 0.96-1.49 for infections of the genitourinary system, and HR = 1.23, 95% CI: 1.06-1.43 for any other infections) in the children, compared to children of women without infections before (and during) pregnancy. CONCLUSIONS: These findings indicate that the maternal immune system, maternal infections, or factors related to maternal immune function play a role in the observed associations between maternal infections before pregnancy and cerebral diseases in the offspring.