Background: The aim of this study was to determine whether type 2 diabetes mellitus and treatment with metformin is associated with prostate cancer risk. Methods: Male patients with diagnosis of type 2 diabetes during the period of 2000 – 2016 were identified in the National Health Insurance Fund database. The prostate cancer cases were identified by pooling these records from the national Cancer Registry. The calculation of prostate cancer stardardized incidence ratios (SIRs) was composed as a ratio of observed number of cancer case in people with diagnosis of diabetes to the expected number of cancer cases in the underlying general population. Results: Overall, 64,000 males diagnosed with diabetes in Lithuania between 2000 and 2016 were included in the final cohort. 2,754 prostate cancers were observed versus 3,111.26 expected within the period of observation entailing an SIR of 0.89 (95% CI: 0.85–0.92). Significantly lower risk of prostate cancer was found in diabetes patients in all age groups, there were no differences in prostate cancer risk by time since diagnosis of diabetes. Significantly lower risk of prostate cancer also was found in both metformin users and never-users’ groups, with higher risk reduction in metformin users (SIR 0.71, 95% CI: 0.68–0.75) than in diabetes patients never-users (SIR 0.88, 95% CI: 0.80–0.96). Conclusions: In this large population-based study we found a significantly decreased risk of prostate cancer among men with diabetes and metformin users. However, the risk of prostate cancer showed no clear trend with diabetes duration and cumulative metformin dose.