Gastric cancer (GC) a prevalent form of cancer globally. Previous research suggests that SHOX2 may have a role in promoting cancer progression. However, the role of SHOX2 in GC is not well understood. Based on data from TCGA_GC data set, SHXO2 levels were examined in normal and GC tissues. Patients in the TCGA_GC cohort were divided into high- and low-SHOX2 level groups for analysis of overall survival (OS), functional enrichment, and immune infiltration. Furthermore, experiments were conducted to investigate the impact of SHOX2 on GC cell function through gain- and loss-of-function experiments. Utilizing data from public databases, SHOX2 mRNA levels were found to be elevated in GC tissues compared to normal control, this finding was confirmed by RT-qPCR, western blot analysis, and immune-histochemical analyses. Elevated SHOX2 levels could serve as an independent indicator of poor prognosis in GC patients. Furthermore, SHOX2 levels had a negative correlation with CD8 T cells and CD4 memory activated T cells, and a positive correlation with of M0 macrophages in GC patients. Functional analyses revealed that SHOX2 deficiency notably suppressed GC cell proliferation, migration, and invasion. Additionally, SHOX2 deficiency was shown to suppress stemness in GC cells in vitro and in vivo via inactivating wnt/β-catenin signaling. Collectively, SHOX2 may serve as a prognostic marker for GC patients, and downregulation of SHOX2 could effectively impede GC cell growth and stemness by inactivating the wnt/β-catenin signaling pathway. These findings underscore the potential of SHOX2 as a promising therapeutic target for GC.