Most gastric cancers develop in patients with chronic gastritis. Chronic gastritis can be classified into two major subtypes: Helicobacter pylori (H. pylori)-induced gastritis and autoimmune gastritis (AIG). Whereas H. pylori-related gastric cancers are more common and have been extensively investigated, the clinicopathological features of gastric cancer with autoimmune gastritis are unclear. Patients diagnosed with gastric cancer and hospitalized in the University Tokyo Hospital from 1998 to 2017 were enrolled. Diagnosis of autoimmune gastritis was based on positivity for serum anti-parietal cell antibody (APCA). We evaluated mucin expression and immune cell infiltration by immunohistochemical staining for MUC5AC, MUC6, PD-L1, CD3, CD11, Foxp3, and PD1. We also examined the presence of bacterial taxa that are reportedly enriched in AIG. Survival analyses of recurrence and 5-year mortality were also performed. In total, 261 patients (76 APCA-positive and 185 APCA-negative) were analyzed. Immunohistochemical staining in the matched cohort showed that AIG-related gastric cancer had higher MUC5AC expression (p = 0.0007) and MUC6 expression (p = 0.0007). Greater infiltration of CD3-positive (p = 0.001), Foxp3-positive (p < 0.001), and PD1-positive cells (p = 0.001); lesser infiltration of CD11b-positive (p = 0.005) cells; and a higher prevalence of Bacillus cereus (p = 0.006) were found in AIG-related gastric cancer patients. The cumulative incidences of gastric cancer recurrence were 2.99% at 2 years, 15.68% at 6 years, and 18.81% at 10 years in APCA-positive patients; they were 12.79% at 2 years, 21.35% at 6 years, and 31.85% at 10 years in APCA-negative patients. The cumulative incidences of mortality were 0% at 3 years and 0% at 5 years in APCA-positive patients; they were 1.52% at 3 years and 2.56% at 5 years in APCA-negative patients. We identified molecular differences between AIG and non-AIG gastric cancer. Differences in T-cell populations and the gastric microbiota may contribute to the pathogenesis of gastric cancers and potentially affect the response to immunotherapy.