Esophageal squamous cell carcinoma (ESCC) is a predominant subtype of esophageal cancer with relatively high mortality worldwide. Serine peptidase inhibitor Kazal-type 5 (SPINK5) is reported to be downregulated in ESCC. However, its explicit role in ESCC remains further investigation. The tumor tissues and adjacent non-cancerous tissues were obtained from 196 patients with ESCC for the determination of SPINK5 mRNA levels. Additionally, the relationship between SPINK5 mRNA levels and clinicopathological features of ESCC patients was explored. The effects of SPINK5 on the invasion and migration of ESCC cells were assessed using Transwell assays. Furthermore, SPINK5 mRNA and LEKTI protein were measured in ESCC cell lines after treatment with poly (I:C), lipopolysaccharide (LPS) or unmethylated CpG DNA. Moreover, the correlation between expression of SPINK5 and nuclear factor-kappa B (NF-κB) signaling pathway-related genes was analyzed in the TCGA-ESCC cohort, and the effects of SPINK5 on NF-κB transcription was analyzed using a luciferase reporter gene assay. Finally, the correlations between SPINK5 and infiltration of immune cells, immune scores, stromal scores and ESTIMATE (i.e., Estimation of STromal and Immune cells in MAlignant Tumor tissues using Expression data) scores were explored. SPINK5 mRNA levels were downregulated in tumor tissues, which was significantly correlated with higher lymph node metastases. Overexpressed SPINK5 inhibited cell invasion and migration in ESCC cell lines. Mechanistically, LPS-induced activation of Toll-like receptor 4 (TLR4) decreased SPINK5 mRNA and LEKTI in KYSE150 and KYSE70 cells. Spearman correlation analysis revealed that SPINK5 mRNA was significantly negatively correlated with a total of seven NF-κB signaling pathway-related genes in TCGA-ESCC patients. Moreover, downregulation of SPINK5 increased and upregulation of SPINK5 decreased the activity of the NF-κB promoter in HEK293T cells. Finally, immune cells infiltration analysis revealed that SPINK5 was significantly correlated with the infiltration of various immune cells, stromal scores, immune scores and ESTIMATE scores. SPINK5 plays critical roles in the TLR4/NF-κB pathway and immune cells infiltration, which might contribute to the ESCC metastasis. The findings of the present study may provide a promising biomarker for the diagnosis and treatment of esophageal squamous cell carcinoma.