The aim of the present study was to determine whether a diagnosis of diabetes mellitus (DM) in a primary setting is associated with an increased risk of subsequent depression. A retrospective cohort design was used based on the Registration Network Family Practice (RNH) database. Patients diagnosed with diabetes mellitus at or after the age of 40 and who were diagnosed between 01-01-1980 and 01-01-2007 (N = 6,140), were compared with age-matched controls from a reference group (N = 18,416) without a history of diabetes. Both groups were followed for an emerging first diagnosis of depression (and/or depressive feelings) until January 1, 2008. 2.0% of the people diagnosed with diabetes mellitus developed a depressive disorder, compared to 1.6% of the reference group. After statistical correction for confounding factors diabetes mellitus was associated with an increased risk of developing subsequent depression (HR 1.26; 95% CI: 1.12-1.42) and/or depressive feelings (HR 1.33; 95% CI: 1.18-1.46). After statistical adjustment practice identification code, age and depression preceding diabetes, were significantly related to a diagnosis of depression. Patients with diabetes mellitus are more likely to develop subsequent depression than persons without a history of diabetes. Results from this large longitudinal study based on a general practice population indicate that this association is weaker than previously found in cross-sectional research using self-report surveys. Several explanations for this dissimilarity are discussed