Phytochemicals found in fruits, vegetables, and plant-based foods have potential protective effects against various diseases, including gastric disorders. This study aimed to analyze the longitudinal association between phytochemical intake and the risk of gastritis/gastric ulcer in Korean adults. This was a prospective cohort study, a community-based cohort conducted as part of the Korean Genome and Epidemiology Study, examining the association between phytochemical intake and the risk of gastritis/gastric ulcer in Korean adults. Dietary information was collected using a validated semi-quantitative food frequency questionnaire, and the phytochemical index (PI) was calculated. The study included 7377 Korean men and women aged 40-69 years without gastritis/gastric ulcer at baseline of the Korea Association Resource study in Korea. The incidence of gastritis/gastric ulcer was determined using a survey questionnaire administered by trained staff. Multivariate Cox proportional hazards regression was used to calculate the hazard ratio and 95% confidence interval to determine the association between PI and risk of gastritis/gastric ulcer. During the median follow-up period of 9.50 years, 729 cases were reported. The fully adjusted model showed a significantly lower risk of gastritis/gastric ulcer in the highest PI quartile compared to the lowest (hazard ratio: 0.78, 95% confidence interval: 0.61-0.98), and this association was linear (p for trend = 0.01). This research indicates that incorporating foods abundant in phytochemicals into one's diet could be associated with a reduced risk of developing gastritis/gastric ulcers. These findings underscore the importance of further investigating the role of phytochemical-rich diets in gastrointestinal health, as demonstrated in this study.