The risk of malignant brain tumors associated with metformin use has rarely been investigated in humans. This retrospective cohort study investigated such an association. Patients with new-onset type 2 diabetes mellitus diagnosed from 1999 to 2005 in the nationwide database of Taiwan’s national health insurance were used to enroll study subjects. We first identified an unmatched cohort of 153,429 ever users and 16,222 never users of metformin. A cohort of 16,222 ever users and 16,222 never users matched on propensity score was then created from this unmatched cohort. All patients were followed up from 1 January 2006 until 31 December 2011. The incidence density was calculated and hazard ratios were derived from Cox regression incorporated with the inverse probability of treatment weighting using a propensity score. The results showed that 27 never users and 155 ever users developed malignant brain tumors in the unmatched cohort. The incidence rate was 37.11 per 100,000 person-years in never users and 21.39 per 100,000 person-years in ever users. The overall hazard ratio comparing ever users versus never users was 0.574 (95% confidence interval: 0.381–0.863). The respective hazard ratios comparing the first (<27.13 months), second (27.13–58.33 months), and third (>58.33 months) tertiles of cumulative duration of metformin therapy versus never users were 0.897 (0.567–1.421), 0.623 (0.395–0.984), and 0.316 (0.192–0.518). In the matched cohort, the overall hazard ratio was 0.317 (0.149–0.673) and the respective hazard ratios were 0.427 (0.129–1.412), 0.509 (0.196–1.322), and 0.087 (0.012–0.639) for the first, second, and third tertile of cumulative duration of metformin therapy. In conclusion, this study shows a risk reduction of malignant brain tumors associated with metformin use in a dose–response pattern. The risk reduction is more remarkable when metformin has been used for approximately 2–5 years.