The tumor immune response is dependent on the interaction between tumor cells and the T-cell subset expressing the T-cell receptor (TCR) repertoire that infiltrates into the tumor microenvironment. The present study explored the diversity and shared TCR repertoires expressed on the surface of locoregional T cells and identified the T lymphocyte subsets infiltrating into esophageal squamous cell carcinoma (ESCC), in order to provide insight into the efficiency of immunotherapy and the development of a novel immune-oriented therapeutic strategy. A total of 53 patients with ESCC were enrolled in the present study, and immunohistochemical analysis of CD3, CD8, CD45RO, FOXP3, CD274, HLA class I and AE1/AE3 was performed. Digital pathological assessment was performed to evaluate the expression level of each marker. The clinicopathological significance of the immuno relation high (IR-Hi) group was assessed. Adaptor ligation PCR and next-generation sequencing were performed to explore the diversity of the TCR repertoire and to investigate the shared TCR repertoire in the IR-Hi group. Repertoire dissimilarity index (RDI) analysis was performed to assess the diversity of TCR, and the existence of shared TCRα and TCRβ was also investigated. Further stratification was performed according to the expression of markers of different T-cell subsets. Patients were stratified into IR-Hi and immuno relation low (IR-Lo) groups. Cancer-specific survival and recurrence-free survival rates were significantly improved in the IR-Hi group compared with in the IT-Lo group. The diversity of the TCR repertoire was significantly higher in the IR-Hi group. TCR repertoire analysis revealed 27 combinations of TCRα and 23 combinations of TCRβ VJ regions that were shared among the IR-Hi group. The IR-Hi group was divided into three clusters. Overall, the current findings revealed that the IR-Hi group maintained the diversity of TCR, and a portion of the IR-Hi cases held the T cells with shared TCR repertoires, implying recognition of shared antigens. The prognosis of patients with ESCC was affected by the existence of immune response cells and may possibly be stratified by the T-cell subsets.