A growing body of evidence has indicated that behaviors of cancers are defined by not only intrinsic activities of tumor cells but also tumor-infiltrating immune cells (TIICs) in the tumor microenvironment. However, it still lacks a well-structured and comprehensive analysis of TIICs and its therapeutic value in esophageal cancer (EC). The proportions of 22 TIICs were evaluated between 150 normal tissues and 141 tumor tissues of EC by the CIBERSORT algorithm. Besides, correlation analyses between proportions of TIICs and clinicopathological characters, including age, gender, histologic grade, tumor location, histologic type, LRP1B mutation, TP53 mutation, tumor stage, lymph node stage, and TNM stage, were conducted. We constructed a risk score model to improve prognostic capacity with 5 TIICs by least absolute shrinkage and selection operator (lasso) regression analysis. The risk score=−1.86∗plasma+2.56∗T cell follicular helper−1.37∗monocytes−3.64∗activated dendritic cells−2.24∗resting mast cells (immune cells in the risk model mean the proportions of immune cell infiltration in EC). Patients in the high-risk group had significantly worse overall survival than these in the low-risk group (HR: 2.146, 95% CI: 1.243-3.705, p=0.0061). Finally, we identified Semustine and Sirolimus as two candidate compounds for the treatment of EC based on CMap analysis. In conclusion, the proportions of TIICs may be important to the progression, prognosis, and treatment of EC.