Background: Gastric cancer (GC) is one of the most fatal malignant tumors with a high mortality rate. Male sex has been proven as an independent risk factor for GC. This study aimed to identify immune-related genes (IRGs) for the prognosis of male GC.Method: RNA sequencing and clinical data were obtained from The Cancer Genome Atlas (TCGA) database. Differentially expressed IRGs between male GC and normal tissues were identified by integrated bioinformatics analysis. Univariate and multivariate Cox regression analysis were applied to screen survival-associated IRGs. Then, GC patients were separated into high- and low-risk groups based on the median risk score. Furthermore, a nomogram was constructed based on the TCGA dataset. The prognostic value of the risk signature model was evaluated by Kaplan-Meier curve, receiver operating characteristic (ROC), Harrell’s concordance index and calibration curves. In addition, the gene expression dataset from Gene Expression Omnibus (GEO) was also downloaded for external validation. The relative proportions of 22 types of infiltrating immune cells in each male GC sample were evaluated using CIBERSORT.Results: A total of 276 differentially expressed IRGs were screened, including 189 up-regulated and 87 down-regulated genes. Subsequently, a seven-IRGs signature (LCN12, CCL21, RNASE2, CGB5, NRG4, AGTR1 and NPR3) was identified and showed a significant association with the overall survival (OS) of male GC patients. Survival analysis indicated that patients with high-risk group exhibited a poor clinical outcome. The result of multivariate analysis revealed that the risk score was an independent prognostic factor. The established nomogram could be used to evaluate the prognosis of individual male GC patients. Further analysis showed that the prognostic model had an excellent predictive performance in both TCGA and validated cohorts. Besides, the result of tumor-infiltrating immune cell analysis indicated that the seven-IRGs signature could reflect the status of the tumor immune microenvironment.Conclusions: Our study developed a novel seven-IRGs risk signature for individualized survival prediction of male GC patients.