The role of the metabolic syndrome in the etiology of esophageal and gastric cancer is unclear.This was a large nationwide cohort study based on data from 11 prospective population-based cohorts in Norway with long-term follow-up, the Cohort of Norway (CONOR) and the third Nord-Trøndelag Health Study (HUNT3). The metabolic syndrome was assessed by objective anthropometric and metabolic biochemical measures and was defined by the presence of at least three of the following five factors: increased waist circumference, elevated triglycerides, low high-density lipoprotein cholesterol, hypertension and high glucose. Newly diagnosed cases of esophageal adenocarcinoma, esophageal squamous-cell carcinoma and gastric adenocarcinoma were identified from the Norwegian Cancer Registry. Hazard ratios (HRs) and 95% confidence intervals (CIs) were estimated using Cox proportional hazard models with adjustment for potential confounders.Among 192,903 participants followed up for an average of 10.6 years, 62 developed esophageal adenocarcinoma, 64 had esophageal squamous-cell carcinoma and 373 had gastric adenocarcinoma. The metabolic syndrome was significantly associated with an increased risk of gastric adenocarcinoma (HR 1.44, 95% CI 1.14-1.82), but not associated with esophageal adenocarcinoma (HR 1.32, 95% CI 0.77-2.26) or esophageal squamous-cell carcinoma (HR 1.08, 95% CI 0.64-1.83). Increased waist circumference was associated with an increased HR of esophageal adenocarcinoma (HR 2.48, 95% CI 1.27-4.85). No significant association was found between any single component of the metabolic syndrome and risk of esophageal squamous-cell carcinoma. High waist circumference (HR 1.71, 95% CI 1.05-2.80), hypertension (HR 2.41, 95% CI 1.44-4.03) and non-fasting glucose (HR 1.74, 95% CI 1.18-2.56) were also related to an increased risk of gastric adenocarcinoma in women, but not in men.Metabolic syndrome was associated with an increased risk of gastric adenocarcinoma in women. Of the individual components of the metabolic syndrome, high waist circumference was positively associated with risk of esophageal adenocarcinoma. Positive associations were also observed for women between high waist circumference, hypertension, high non-fasting glucose and risk of gastric adenocarcinoma. However, further evidence is warranted due to the limited number of cases and the inability to effectively identify gastric cardia adenocarcinoma.