Background Establishment of sister chromatid cohesion N-acetyltransferase 2 (ESCO2), a member of the EFO2 family, is implicated in the pathogenesis and progression of various cancers. However, there has been limited comprehensive pan-cancer analysis conducted on ESCO2 thus far. Methods Publicly available databases, such as the UCSC Xena database, were utilized to examine differential expression patterns across various cancer types. In addition, variations in expression levels were investigated across distinct clinical stages. Univariate Cox regression and Kaplan-Meier survival analyses were conducted to evaluate the impact on overall survival (OS), disease-specific survival (DSS), disease-free interval (DFI), and progression-free interval (PFI) at a pan-cancer level. The correlation between ESCO2 expression and immune cell infiltration was examined to gain insight into the tumor microenvironment in different cancers. The results of the bioinformatic analysis were validated using immunotherapy clinical trials and pathological specimens. CCK-8 and transwell assay experiments were performed to investigate the biological function of ESCO2. Results ESCO2 expression was found to be up-regulated in most cancers, with a correlation to TNM stages. Prognostic analysis indicated that overexpression of ESCO2 was associated with poor prognosis in various cancers. Furthermore, the correlation between ESCO2 expression and immune cell infiltration suggested its potential as a predictor for immunotherapy efficacy. Notably, ESCO2 expression showed positive associations with immunoinhibitor, immnostimulator, MHC molecule, chemokine receptor, tumor mutation burden (TMB) and microsatellite instability (MSI) levels in bladder cancer (BLCA). The validation cohort for immunotherapy corroborated these findings and substantiated that ESCO2 could function as an autonomous prognostic biomarker and a promising target for cancer treatment via immunotherapy. In addition, in vitro experiments confirmed the role of ESCO2 in influcing the proliferation, invasion and migration of BLCA cells. Conclusion ESCO2 participates in regulating the immune infiltration and affecting the prognosis of patients in many cancers, especially in BLCA. ESCO2 may serve as a prognostic and immunotherapy biomarker in future treatment of human cancer.