SummaryTo investigate vitamin D status in children with community-acquired pneumonia (CAP) and explore the association between vitamin D deficiency and the immune response in CAP children, 77 children with CAP were retrospectively analyzed. The baseline characteristics of patients were obtained from medical records. Based on the blood samples collected during diagnosis of CAP, the routine blood examination results and proportions of lymphocyte subsets were assessed. There were 71.4% (55/77) of patients with vitamin D deficiency among CAP children. The serum 25(OH)D level significantly decreased with age. Patients with vitamin D deficiency had a significantly higher neutrophil percentage, but significantly lower lymphocyte percentage and count as well as proportion of CD19 positive lymphocytes (CD191). Spearman's rho test further confirmed these positive correlations and negative correlations. Moreover, significant associations of vitamin D deficiency with age and the above immune markers were also confirmed by univariate logistic regression analysis. However, only age entered the backward stepwise regression model in multivariate analysis. Vitamin D status in CAP children was negatively associated with age. Age-related vitamin D deficiency may affect the immune response in children with CAP.