In patients with diabetes mellitus (DM), there are changes in vascular reactivity and nerve conduction that may be relevant for migraine pathophysiology. However, previous studies on the relationship between headache and DM have shown conflicting results. The aim of the present study was to investigate a possible association between headache and DM in a large population-based cross-sectional study. Associations were assessed in multivariate analyses, estimating prevalence odds ratios (ORs) with 95% confidence intervals (CIs). Prevalence OR of migraine was lower amongst persons with DM compared with those without DM, the OR being 0.4 (95% CI: 0.2-0.9) for type 1 and 0.7 (95% CI: 0.5-0.9) for type 2 DM. Furthermore, OR of headache were lower amongst those with duration of DM > or = 13 years compared with those who had got DM the last 3 years, OR 0.6 (95% CI: 0.4-0.9). The analyses revealed no clear associations between non-migrainous headache and DM. The reason for the inverse relationship between migraine and DM is unknown, but might be related to pathophysiological abnormalities in patients with DM that protect against migraine.