Advanced gastric cancer (AGC) is characterized by poor prognosis and limited responsiveness to immunotherapy. Tumor-associated macrophages (TAMs) play a pivotal role in cancer progression and therapeutic outcomes. In this study, we developed a novel gene signature associated with M1-like TAMs using data from the Gene Expression Omnibus (GEO) and The Cancer Genome Atlas (TCGA) to predict prognosis and immunotherapy response. This gene signature was determined as an independent prognostic indicator for AGC, with high-risk patients exhibiting an immunosuppressive tumor immune microenvironment (TIME) and poorer survival outcomes. Furthermore, Interferon regulatory factor 8 (