Insulin resistance is a central feature of type 2 diabetes mellitus (DM) and may increase the risk of kidney stone formation. Existing cross-sectional data on the association between DM and nephrolithiasis are limited, and no prospective study to date has evaluated the relation between DM and the risk of kidney stones. To evaluate the relation between DM and prevalent kidney stones, we conducted a cross-sectional study of 3 large cohorts including over 200,000 participants: the Nurses' Health Study I (older women), the Nurses' Health Study II (younger women), and the Health Professionals Follow-up Study (men). We then prospectively studied the association between DM and incident nephrolithiasis over a combined 44 years of follow-up. Because insulin resistance can precede the diagnosis of DM by decades, we also prospectively examined the relation between kidney stones and the diagnosis of incident DM. Multivariate regression models adjusted for age, body mass index, thiazide diuretic use, fluid intake, and dietary factors. At baseline, the multivariate relative risk of prevalent stone disease in individuals with DM compared to individuals without was 1.38 (95% CI 1.06-1.79) in older women, 1.67 (95% CI 1.28-2.20) in younger women, and 1.31 (95% CI 1.11-1.54) in men. Prospectively, the multivariate relative risk of incident kidney stone formation in participants with DM compared to participants without was 1.29 (95% CI 1.05-1.58) in older women, 1.60 (95% CI 1.16-2.21) in younger women, and 0.81 (95% CI 0.59-1.09) in men. The multivariate relative risk of incident DM in participants with a history of kidney stones compared to participants without was 1.33 (95% CI 1.18-1.50) in older women, 1.48 (95% CI 1.14-1.91) in younger women, and 1.49 (95% CI 1.29-1.72) in men. DM is a risk factor for the development of kidney stones. Additional studies are needed to determine if the increased risk of DM in stone formers is due to subclinical insulin resistance.