Undernutrition is associated with increased mortality after hospitalization with community-acquired pneumonia (CAP), whereas obesity is associated with decreased mortality in most studies. We aimed to determine whether undernutrition and obesity are associated with increased risk of re-hospitalization and post-discharge mortality after hospitalization. This study was nested within the Surviving Pneumonia cohort, which is a prospective cohort of adults hospitalized with CAP. Patients were categorized as undernourished, well-nourished, overweight, or obese. Undernutrition was based on diagnostic criteria by the European Society for Clinical Nutrition and Metabolism. Risk of mortality was investigated using multivariate logistic regression and re-hospitalization with competing risk Cox regression where death was the competing event. Compared to well-nourished patients, undernourished patients had a higher risk of 90-day (OR 3.0, 95% CI 1.0; 21.4) mortality, but a similar 30-day and 180-day mortality risk. Obese patients had a similar re-hospitalization and mortality risk as well-nourished patients. In conclusion, among patients with CAP, undernutrition was associated with increased risk of mortality. Undernourished patients are high-risk patients, and our results indicate that in-hospital screening of undernutrition should be implemented to identify patients at mortality risk. Studies are required to investigate whether nutritional therapy after hospitalization with CAP would improve survival.