To analyze the characteristics of cellular immune function and its prognostic risk factors in patients with community-acquired pneumonia (CAP). The clinical data of patients diagnosed as CAP admitted to department of respiratory and critical care medicine of the Second Affiliated Hospital of Anhui Medical University from June 2018 to February 2019 were retrospectively analyzed. The patients were divided into survival group and death group according to the mortality at discharge and 28-day survival after hospital discharge; in addition, they were divided into bacterial group, fungi group and mixed infection group according to pathogen results at discharge. The differences of general clinical characteristics, arterial blood gas analysis indexes, plasma albumin, cellular immune function, inflammatory cytokines, the length of hospital stay among groups were analyzed. The correlation between the prognosis-related indicators in patients were analyzed by Pearson test or Spearman test, and Logistic regression model was used to analyze the risk factors of patients in non-survival group. 106 patients were finally enrolled, 69 of whom were survived, and 37 dead. Among 56 patients with pathogen results, 27 were diagnosed as bacterial infection, 11 as fungal infection, and 18 with mixed infection. Compared with the survival group, plasma albumin level, total T cell count, CD4+T cell count, CD8+T cell count were decreased in the death group, temperature, pH, acute physiology and chronic health evaluation II (APACHE II), procalcitonin (PCT), interleukin-6 (IL-6), C-reactive protein (CRP) were increased, and the length of hospital stay was significantly shortened. While there was no significant difference in gender, age, mean arterial pressure, arterial oxygen pressure, CD4+/CD8+, regulation T cell/effect T cell (TREG/TEF) between the two groups. Correlation analysis showed that plasma albumin, the length of hospital stay, APACHE II score, CD4+T cell count, CD8+T cell count, CD4+/CD8+, PCT, IL-6, CRP were correlated with death (r value was -0.480, -0.209, 0.203, -0.279, -0.270, 0.271, 0.247, 0.410, 0.329, all P < 0.05). Logistic regression analysis showed that plasma albumin, CD4+T cell count, CD8+T cell count, CD4+/CD8+decreased; APACHE II score, PCT, IL-6, and CRP increased; the length of hospital stay were correlated with death, and all were independent risk factors for death in CAP patients (all P < 0.05). Correlation analysis showed that the APACHE II score was negatively related to plasma albumin (r = -0.375, P < 0.05), positively related to CRP and IL-6 (r value was 0.363 and 0.333 respectively, both P < 0.05); negative correlation between plasma albumin and IL-6 (r = -0.372, P < 0.05), PCT and CD4+T cell count (r = -0.354, P < 0.05), CRP and the length of hospital stay (r = -0.356, P < 0.05). There were no significant correlations between the others. There was no significant difference in cellular immune function or inflammatory factor expression between different pathogenic infections. Cellular immune dysfunction, hypoproteinemia, APACHE II score and elevated inflammatory index are all influential factors for the death of CAP patients. Apart from conventional anti-infective treatment, the symptoms of hypoproteinemia and cellular immune function can predict the severity and prognosis of CAP patients.