Abstract Background Human Immunodeficiency Virus (HIV) is one of the most prevalent viruses, causing significant immune depletion in affected individuals. Current treatments can control HIV and prolong patients’ lives, but new challenges have emerged. Increasing incidence of cancers occur in HIV patients. Esophageal squamous cell carcinoma (ESCC) is one of the most common cancers observed in HIV patients. However, the spatial cellular characteristics of HIV-related ESCC have not been explored, and the differences between HIV-ESCC and typical ESCC remain unclear. Methods We performed spatial transcriptome sequencing on HIV-ESCC samples to depict the microenvironment and employed cell communication analysis and multiplex immunofluorescence to investigate the molecular mechanism in HIV-ESCC. Results We found that HIV-ESCC exhibited a unique cellular composition, with fibroblasts and epithelial cells intermixed throughout the tumor tissue, lacking obvious spatial separation, while other cell types were sparse. Besides, HIV-ESCC exhibited an immune desert phenotype, characterized by a low degree of immune cell infiltration, with only a few SPP1^+ macrophages showing immune resistance functions. Cell communication analysis and multiplex immunofluorescence staining revealed that tumor fibroblasts in HIV-ESCC interact with CD44^+ epithelial cells via COL1A2, promoting the expression of PIK3R1 in epithelial cells. This interaction activates the PI3K-AKT signaling pathway, which contributes to the progression of HIV-ESCC. Conclusions Our findings depict the spatial microenvironment of HIV-ESCC and elucidate a molecular mechanism in the progression of HIV-ESCC. This will provide us insights into the molecular basis of HIV-ESCC and potential treatment strategies. Supplementary Information The online version contains supplementary material available at 10.1186/s12943-025-02248-3. Keywords: Esophageal squamous cell carcinoma, HIV, Spatial transcriptome, Tumor microenvironment Background Human Immunodeficiency Virus (HIV) is a retrovirus that compromises the human immune system by targeting and destroying crucial immune cells [[38]1]. As a result, individuals infected with HIV are vulnerable to various opportunistic infections and malignancies, which can profoundly affect their overall health and pose life-threatening risks. The introduction of highly active antiretroviral therapy (HAART) has revolutionized the management of HIV, transforming it from a once-fatal disease into a manageable chronic condition. This advancement has significantly prolonged the lives of people living with HIV (PLWH). However, despite these progressions, the prevalence of chronic comorbidities within this population has emerged as a critical concern [[39]2]. Currently, cancer has increasingly emerged as one of the leading causes of death among individuals living with HIV. The incidence of tumors in this population is markedly higher than in the general public. Furthermore, the interaction between HIV and various tumors poses considerable challenges in effectively treating patients affected by both conditions [[40]3, [41]4]. In recent years, esophageal squamous cell carcinoma (ESCC) has been found to be one of the most common cancers in HIV-positive patients [[42]5, [43]6]. Esophageal cancer is a prevalent malignant tumor, with ESCC accounting for over 80% of cases [[44]7]. China is recognized as a high-incidence region for ESCC, comprising approximately half of the global population of affected patients [[45]8]. The early symptoms of ESCC are often subtle, and clinical treatment outcomes are generally poor, contributing to a low five-year survival rate among patients [[46]9]. Surgical resection remains one of the most effective methods for curing ESCC. However, the tumor’s anatomical location can complicate surgery, resulting in significant surgical trauma and reduced patient tolerance. These factors consequently increase rates of surgical mortality and postoperative complications. Moreover, the pathological and physiological changes brought on by HIV infection can elevate the risk of opportunistic infections following surgery. Such complications may include wound infections, impaired wound healing, and anastomotic leaks [[47]10]. In severely infected individuals, these issues can escalate to multiple organ failure and even death. As a result, there are notable differences in the clinical presentation and treatment approaches for ESCC associated with HIV compared to those without HIV infection. However, research on ESCC with HIV infection (HIV-ESCC) remains limited, primarily due to the unique characteristics of this patient population. Only two earlier studies indicated that HIV infection is a risk factor affecting the prognosis of ESCC patients [[48]11, [49]12]. Moreover, broader investigations into HIV-related tumors suggest that cancer patients with HIV generally experience poorer prognoses. For instance, Szychowiak et al. revealed that individuals with both HIV and cancer face higher mortality rates [[50]13]. Similarly, Salahuddin et al. demonstrated that the prognosis for head and neck squamous cell carcinoma patients living with HIV is significantly worse compared to their non-HIV-associated counterparts, indicating that HIV serves as an independent predictor of adverse clinical outcomes [[51]14]. The poor prognosis of patients with HIV-related tumors could be due to significant changes at the cellular and molecular levels. In patients with both HIV and lung cancer, there is a markedly higher frequency of microsatellite alterations and genomic instability [[52]15]. Furthermore, compared to cancer patients who are not infected with HIV, those with HIV may experience declines in CD4^+ T cell counts and increased mortality rates as a result of chemotherapy and radiotherapy [[53]16]. In addition, HIV infection is closely associated with elevated PD-L1 expression in liver cancer cells and the surrounding tumor microenvironment, which contributes to a highly immune-exhausted state. This condition alters the functions of cytotoxic and regulatory T cells and disrupts pro-inflammatory pathways, ultimately impacting the efficacy of immunotherapy [[54]17]. Despite these findings, there lacks the study to explore the molecular mechanisms underlying HIV-ESCC. Therefore, there is an urgent need to understand the cellular and molecular characteristics of HIV-ESCC. Such investigations could offer new insights and directions for the diagnosis and treatment of this complex condition. Currently, spatial transcriptomics is an innovative technique employed to study gene expression across different tissue and cell types. Unlike traditional transcriptomic studies, which often homogenize tissue samples and consequently lose critical spatial information, spatial transcriptomics preserves this spatial context. This approach allows for a more comprehensive understanding of the heterogeneity and interactions among various cell types within the tumor microenvironment, providing new insights to improve cancer treatment strategies. Several studies have explored the application of spatial transcriptomics in ESCC. For example, Guo et al. integrated spatial transcriptomics with single-cell transcriptomics to reveal the distributional heterogeneity of various stromal cells and their subpopulations in ESCC [[55]18]. Similarly, Liu et al. utilized spatial transcriptomics to identify key genes involved in the progression from precancerous lesions to malignant tumors in ESCC [[56]19]. These findings indicate that employing spatial transcriptomics to investigate HIV-ESCC could illustrate the specific changes in the tumor microenvironment attributable to HIV infection, thus uncovering critical underlying mechanisms. Here, this study aims to leverage advanced spatial transcriptomics sequencing technology to thoroughly explore the essential molecular mechanisms of HIV-ESCC at the spatial cellular level of tumor, highlighting the mechanistic differences between HIV-ESCC and non-HIV-associated ESCC. Methods Sample collection Patients included in this study were recruited from The Public Health Clinical Center of Chengdu. The inclusion criteria were as follows: (1) patients who underwent surgical treatment without any prior neoadjuvant therapies such as chemotherapy, radiotherapy, or molecular targeted therapy; (2) individuals confirmed to be HIV-positive through standardized HIV diagnostic testing, with esophageal squamous cell carcinoma verified through preoperative and postoperative biopsies; (3) patients with no evidence of tumor metastasis; (4) aged between 18 and 95 years. Written informed consent was obtained from all participants involved in this study. Here, we selected two samples for spatial transcriptomic sequencing (Table [57]S1). Spatial transcriptome sequencing Fresh tissue samples were embedded in pre-cooled OCT and stored at -80 °C. Sections were cryosectioned, assessed for RNA integrity (RIN ≥ 7), and stained with hematoxylin and eosin (H&E) for structural evaluation. Using the 10X Genomics Visium platform, tissue sections were permeabilized to optimize mRNA capture, with optimal conditions determined based on fluorescence signal quality. Library construction followed the Visium Spatial Gene Expression protocol, including reverse transcription, cDNA amplification and quality control. Sequencing was conducted on an Illumina NovaSeq 2000 system, achieving a depth of 50,000-100,000 reads per spot. Raw data processing Histological images were manually aligned using 10X Visium Loupe Browser (v4.0.0), marking spots with > 50% tissue content as tissue regions and others as background, to refine tissue boundaries. Alignment results were exported for processing with Space Ranger (v1.3.0; 10x Genomics). Raw FASTQ files, histological images and the JSON alignment file were aligned to the GRCh38 reference genome, generating the primary gene expression matrix. For details on Loupe Browser usage, see [58]https://support.10xgenomics.com/spatial-gene-expression/software/vi sualization/latest/alignment; the reference genome can be downloaded from [59]https://cf.10xgenomics.com/supp/spatial-exp/refdata-gex-GRCh38-2020 -A.tar.gz. Quality control and dimensionality reduction clustering For the Gene-Spot matrix generated by Space Ranger, initial statistical analyses were conducted, including calculating the number of UMIs and genes detected in each spot. For each ST sample, spots with fewer than 200 detected genes or with over 20% mitochondrial gene expression were filtered out. The filtered data were then processed using stLearn [[60]20], including gene filtering, total count normalization, log transformation, data centering, and PCA for dimensionality reduction (selecting the top 50 principal components). Subsequently, each valid spot’s image area was extracted, and high-level features were obtained using deep learning. The SME (Spatial Morphological Extraction) normalization algorithm was then applied, smoothing gene expression values at each center spot based on the morphological similarity of its neighboring spots. This normalized data was further scaled and dimensionally reduced. Finally, a neighborhood graph (n_neighbors = 17) was constructed from the SME-normalized data, and Louvain clustering (resolution = 1.19) was performed. The results were visualized using a UMAP (Uniform Manifold Approximation and Projection) plot, which effectively displayed the spatial distribution of clusters. Histopathological notes In this study, pathologists annotated the H&E-stained images of the sequencing specimens. Based on the histomorphological characteristics of samples, they identified and delineated tumor tissue regions and adjacent normal tissue regions. Inference of CNV We inferred copy number variation (CNV) abnormalities based on disturbances in chromosomal gene expression. The inferCNV method was employed to estimate the CNV of each tumor spot according to its transcriptomic profile [[61]21]. For each patient, spots annotated by pathologists as adjacent normal regions were defined as normal references. The gene expression count matrix served as the input, and