ObjectiveThe purpose of this research was to evaluate the influence of immunity on infection in patients with severe hemorrhagic stroke and explore the mechanism underlying this connection.MethodsClinical data obtained from 126 patients with severe hemorrhagic stroke were retrospectively analyzed, and the factors affecting infection were screened by multivariable logistic regression models. Nomograms, calibration curves, the Hosmer–Lemeshow goodness-of-fit test, and decision curve analysis were used to examine the effectiveness of the models in evaluating infection. The mechanism underlying the reduction in CD4+T-cell levels in blood was explored by analysis of lymphocyte subsets and cytokines in cerebrospinal fluid (CSF) and blood.ResultsThe results showed that CD4+T-cell levels of <300/μL was an independent risk factor for early infection. The models for multivariable logistic regression involving the CD4+T-cell levels and other influencing factors had good applicability and effectiveness in evaluating early infection. CD4+T-cell levels decreased in blood but increased in CSF. Similarly, interleukin (IL)-6 and IL-8 levels in CSF had a significant increase, generating a substantial concentration gradient between the CSF and the blood.ConclusionReduced blood CD4+T-cell counts among patients who had severe hemorrhagic stroke increased the risk of early infection. CSF IL-6 and IL-8 may be involved in inducing the migration of CD4+T cells into the CSF and decreasing blood CD4+T-cell levels.