Coinciding with the increased incidence of non-Hodgkin's lymphoma (NHL) during the past decades, there has been a significant increase in the prevalence of diabetes mellitus in mainland China. We therefore evaluated whether type 2 diabetes (T2D) is associated with the risk of NHL using data from the Shanghai Men's Health Study (SMHS) and the Shanghai Women's Health Study (SWHS). The SMHS and SWHS are two on-going, prospective, population-based cohorts of more than 130 000 Chinese adults in urban Shanghai. Self-reported diabetes was recorded on the baseline questionnaire and updated in follow-up surveys. Cox regression models with T2D as a time-varying exposure were used to estimate hazard ratios and 95% confidence intervals, adjusting for covariates. After a median follow-up of 12.9 years for SWHS and 7.4 years for SMHS, 172 NHL cases were identified. Patients with T2D have a higher risk of incident NHL with a hazard ratio of 2.00 (95% confidence interval: 1.32-3.03) compared with those without diabetes. This positive association remained when the analysis was restricted to untreated diabetes or after excluding NHL cases that occurred within 3 years after the onset of diabetes. No interaction effect was found in the development of NHL between T2D and other potential risk factors. A linear inverse association was found between T2D duration and the risk of NHL in both men and women (Pfor linearity<0.01), with a highest risk of incident NHL in the first 5 years after the diagnosis of diabetes. Our study suggested that T2D might be associated with an increased risk of NHL.