Background: Immune cells and stromal cells in the tumor microenvironment (TME) play a vital role in the initiation and progression of colorectal cancer (CRC). The study aimed to screen valuable prognostic biomarkers in CRC based on stromal and immune scores.Method: We used the ESTIMATE algorithm to calculate the immune and stromal scores of CRC samples in TCGA. Then the CRC samples were divided into high and low score groups based on the median value of the immune and stromal scores. Differentially expressed genes (DEGs) associated with immune score and stromal score were screened. WGCNA and univariate COX regression analysis were performed to further identify key prognostic genes. The prognostic value of key genes was validated based on The Gene Expression Profiling Interactive Analysis (GEPIA) and GSE17536 dataset.TIMER and CIBERSORT algorithms were applied to analyze the correlations among key genes and tumor-infiltrating immune cells. Several pairs of colon cancer tissue were used to be proven.Result: 1314 upregulated and 4 downregulated genes associated with immune score and stromal score were identified, which were significantly enriched in immune-related biological processes and pathways. Among these DEGs, SPOCK1 and POSTN were identified as key prognostic genes. High expression of SPCOK1 and POSTN was associated with advanced clinical stage, T stage, N stage, and poor prognosis of CRC. The results from CIBERSORT and TIMER revealed that SPOCK1 and POSTN were associated with tumor-infiltrating immune cells, especially macrophages and neutrophils. Meanwhile, in several pairs of human colorectal tissue samples, SPOK1 and POSTN were found to be significantly overexpressed in colorectal tissue compared with para-cancer tissue, and macrophage surface markers CD68 (co-expressed by M1 and M2 macrophages) and CD206 (M2-specific macrophage expression) were also overexpressed in cancer tissue. Besides, SPOCK1 and POSTN expression were positively correlated with the expression of immune checkpoints.Conclusion: Collectively, our results indicate that SPOCK1 and POSTN may be novel prognostic biomarkers in CRC and correlate with immune infiltrates.