Metformin use has been associated with a decreased incidence and mortality of various cancers. To evaluate the association between metformin use and gastric cancer. We randomly selected 100000 type 2 diabetic patients from the 2004 Korean National Health Insurance claim database, and assessed gastric cancer incidence among 39989 patients (aged 30-97years) who were regularly treated with anti-diabetic drugs and followed-up from 2004 to 2010. In total, 26690 patients had used metformin out of 32978 diabetics who had not regularly used insulin (insulin non-users), and 5855 patients had used metformin out of 7011 regular insulin users. Patients who used metformin showed a lower incidence of gastric cancer than those who did not use metformin, in insulin non-users (P=0.047, log-rank test). However, in patients on regular insulin, there was no difference of gastric cancer incidence according to metformin use. In insulin non-users, the adjusted hazard ratio (AHR) for metformin use was 0.73 (95% confidential interval [CI], 0.53-1.01) with borderline statistical significance (P=0.059). Duration of metformin use was associated with the reduction in gastric cancer risk (AHR, 0.88; 95% CI 0.81-0.96, P=0.003), especially in patients who used metformin for more than 3years (AHR, 0.57; 95% CI, 0.37-0.87; P=0.009). Metformin use >3years in type 2 diabetics who do not use insulin is associated with a significantly reduced gastric cancer risk.