Objective: To accurately measure the incidence of gastric cancer among patients with gastric precancerous lesions, and to quantify the excess incidence in comparison with people with normal mucosa on endoscopy and a general population. Design: Population based cohort study. Setting: Population of Sweden using data from its national disease registers. Participants: 405 172 patients who had gastric biopsy samples taken for non-malignant indications between 1979 and 2011. Main outcom e measures: Incidence of gastric cancer, reported separately for patients with different mucosal changes in biopsy samples. Standardised incidence ratios provided estimation of the relative risk, using the general Swedish population as reference; and hazard ratios were derived from Cox regression modelling for internal comparisons with patients with normal gastric mucosa. Results: After excluding the first two years of follow-up, 1599 cases of gastric cancer were identified. The annual crude incidence of gastric cancer was 20×10-5 for those in the normal mucosa group (standardised incidence ratio 1.0), 42×10-5 for those with minor changes (1.5), 59×10-5 for the gastritis group (1.8), 100×10-5 for the atrophic gastritis group (2.8), 129×10-5 for the intestinal metaplasia group (3.4), and 263×10-5 for the dysplasia group (6.5). Cox regression modelling confirmed that excess risks increased monotonically with progressive severity of gastric lesions, with the highest hazard ratio of 10.9 (dysplasia versus normal mucosa, 95% confidence interval 7.7 to 15.4). The increased incidence was stable throughout the follow-up period, and the gaps between cumulative incidence curves grew continuously. Conclusions: Among patients who undergo gastroscopy with biopsy for clinical indications, approximately 1 in 256 with normal mucosa, 1 in 85 with gastritis, 1 in 50 with atrophic gastritis, 1 in 39 with intestinal metaplasia, and 1 in 19 with dysplasia will develop gastric cancer within 20 years. These numbers, along with costbenefit analyses, should guide future surveillance policies for these particular patient groups.