Maternal diabetes preceding pregnancy may increase the risk of birth defects in the offspring, but not all studies confirm this association, which has shown considerable variation over time, and the effect of having type 1 versus type 2 diabetes is unclear. We conducted a population-based cohort study in the Northern Italy Emilia-Romagna region linking administrative databases with a Birth Defects Registry. From hospital discharge records we identified all diabetic pregnancies during 1997-2010, and a population of non-diabetic parturients matched for age, residence, year and delivery hospital. We collected available information on education, smoking and drug prescriptions, from which we inferred the type of diabetes. We found 62 malformed infants out of 2,269 births among diabetic women, and 162 out of 10,648 births among non-diabetic women. The age-standardized prevalence ratio (PR) of malformation associated with maternal pregestational diabetes was 1.79 (95% confidence interval 1.34-2.39), a value that varied little by age. Type of diabetes strongly influenced the PR, with higher values related to type 2 diabetic women. Most major subgroups of anomalies had PRs above 1, including cardiovascular, genitourinary, musculoskeletal, and chromosomal abnormalities. There was an unusually high PR for the rare defect 'extra-ribs', but it was based on only two cases. This study indicates that maternal pregestational type 2 diabetes is associated with a higher prevalence of specific birth defects in offspring, whereas for type 1 diabetic mothers, particularly in recent years, the association was unremarkable.