Purpose: Nosocomial infection contributes to adverse outcome after brain injury. This study investigates whether autonomic nervous system activity is associated with a decreased host immune response in patients following stroke or traumatic brain injury (TBI). Methods: A prospective study was performed in adult patients with TBI or stroke who were admitted to the Intensive Care Unit of our tertiary university hospital between 2013 and 2016. Heart rate variability (HRV) was recorded daily and assessed for autonomic nervous system activity. Outcomes were nosocomial infections and immunosuppression, which was assessed ex vivo using whole blood stimulations with plasma of patients with infections, matched non-infected patients and healthy controls. Results: Out of 64 brain injured patients, 23 (36%) developed an infection during their hospital stay. The ability of brain injured patients to generate a host response to the bacterial endotoxin lipopolysaccharides (LPS) was diminished compared to healthy controls (p < 0.001). Patients who developed an infection yielded significantly lower TNF-α values (86 vs 192 pg/mL, p = 0.030) and a trend towards higher IL-10 values (122 vs 84 pg/mL, p = 0.071) following ex vivo whole blood stimulations when compared to patients not developing an infection. This decreased host immune response was associated with altered admission HRV values. Brain injured patients who developed an infection showed increased normalized high-frequency power compared to patients not developing an infection (0.54 vs 0.36, p = 0.033), whereas normalized low-frequency power was lower in infected patients (0.46 vs 0.64, p = 0.033). Conclusion: Brain injured patients developing a nosocomial infection show parasympathetic predominance in the acute phase following brain injury, reflected by alterations in HRV, which parallels a decreased ability to generate an immune response to stimulation with LPS.