Dutch researchers found vitamin D levels accurately predicted the risk of dying from pneumonia within one month after admission.
Treating deficient patients with vitamin D could be used to stimulate their immune system and improve outcomes, they said.
Researchers also found that adding vitamin D to the current prognostic tool, the pneumonia severity index (PSI), would improve its accuracy.
The findings were presented at the European Respiratory Society Annual Congress 2012 in Vienna on Sunday.
Vitamin D deficiency has an important role in the body's immune system, but its usefulness in predicting outcomes had been unclear.
Researchers examined disease severity and outcomes in 272 adults attending the emergency department with community-acquired pneumonia. Over half (53%) of patients were vitamin D deficient, of which 24% had severe deficiency.
The team then looked at vitamin D status among these patients and compared this to their immune responses, including levels of C-reactive protein, total cortisol and leukocytes.
They found severe vitamin D deficiency raised the risk of intensive care admission and 30-day mortality.
Levels of vitamin D independently predicted 30-day mortality, and improved the accuracy of the PSI score from 78% to 85%.
Co-author Dr Sabine Meijvis from the St Antonius Hospital in Nieuwegein, the Netherlands, said: 'Based on these results, [testing] vitamin D levels on admissions could be a useful prognostic biomarker for patients with pneumonia.'
She added: 'Based on the observational design of the study, we are unable to establish a causal relationship between vitamin D levels and adverse outcomes. However, when future studies are able to confirm such a causal relationship, vitamin D supplementation might be a promising candidate for adjuvant treatment during pneumonia.'
Researchers plan to investigate whether the lower number of immune cells called cytokines found in patients with vitamin D deficiency are to blame for the raised risk.