Purpose To evaluate the association between cumulative duration of metformin use after prostate cancer (PC) diagnosis and all-cause and PC-specific mortality among patients with diabetes. Patients and Methods We used a population-based retrospective cohort design. Data were obtained from several Ontario health care administrative databases. Within a cohort of men older than age 66 years with incident diabetes who subsequently developed PC, we examined the effect of duration of antidiabetic medication exposure after PC diagnosis on all-cause and PC-specific mortality. Crude and adjusted hazard ratios (HRs) were calculated by using a time-varying Cox proportional hazard model to estimate effects. Results The cohort consisted of 3,837 patients. Median age at diagnosis of PC was 75 years (interquartile range [IQR], 72 to 79 years). During a median follow-up of 4.64 years (IQR, 2.7 to 7.1 years), 1,343 (35%) died, and 291 patients (7.6%) died as a result of PC. Cumulative duration of metformin treatment after PC diagnosis was associated with a significant decreased risk of PC-specific and all-cause mortality in a dose-dependent fashion. Adjusted HR for PC-specific mortality was 0.76 (95% CI, 0.64 to 0.89) for each additional 6 months of metformin use. The association with all-cause mortality was also significant but declined over time from an HR of 0.76 in the first 6 months to 0.93 between 24 and 30 months. There was no relationship between cumulative use of other antidiabetic drugs and either outcome. Conclusion Increased cumulative duration of metformin exposure after PC diagnosis was associated with decreases in both all-cause and PC-specific mortality among diabetic men.