The inflammatory disease ulcerative colitis (UC) is multifaceted, immune-mediated, chronic, and relapsing, which is considered to be mainly driven by dysregulated mucosal immune response. The remission of the inflammatory response is a marker of mucosal healing, relating to the low risk of hospitalizations, colorectal cancer, and colectomy. In spite of this, it is still unclear what the key immunological mechanism is which contributes to UC. Here, we explored the immune mechanism and related key genes underlying the state of inflammation in UC. Co-expression networks were constructed based on the expression profiles of immune-related genes in GSE179285. Using Weighted Gene Co-expression Network Analysis and Protein-protein interactions analysis, common hub genes were identified in the module of interest. Then, screening of real hub genes, significantly differentially expressing in inflamed UC, was carried out by Differential Expression Genes Analysis of GSE75214, GSE53306, and GSE6731datasets and immunohistochemistry of clinical samples. The diagnosis Capacity of the hub gene was identified by "glm" function in R. The potential key immune-related mechanisms were investigated using functional enrichment analysis and gene set enrichment analysis (GSEA). Bioinformatics tools were used to predict potential upstream transcription factors (TF), including the UCSC genome browser, correlation analyses, and JASPAR browser. The analysis revealed the blue module, consisting of 227 immune-related genes, showed the highest correlation with inflamed UC. And then, forty-three common candidates were distinguished. S100A9 was identified within the key module as a real hub gene with good diagnostic performance. The immune genes in the blue module were markedly enriched in the Cytokine-Cytokine receptor interaction. S100A9 most likely gets involved NOD-like receptor (NLR) signaling pathway. SPI1 showed the strongest likelihood to be the regulator. S100A9 was identified as the real immune-related hub gene for inflamed UC. Both diagnosis and remission may be aided by its high expression in the inflamed UC.