To analyze the correlation between the complication by community-acquired pneumonia (CAP) and the short-term prognosis in hospitalized acute myocardial infarction (AMI) patients. Five thousand five hundred and twenty-four AMI patients hospitalized in the PLA General Hospital from January 1993 to December 2009 were enrolled for clinical data, incidence of complications and 30-day mortality. The data from patients with and without CAP complications were compared. Multivariate logistic regression analysis was employed to assess the impact of CAP on the short-term prognosis of these patients. In all 5 524 AMI patients studied, 477 cases of CAP was found (8.6%) . In comparison with those without CAP complication, these patients had higher age (74.3 ± 6.5 vs. 67.8 ± 4.5). The incidence of comorbidities [including old myocardial infarction (20.8% vs. 11.5%), hypertension (54.3% vs. 48.9%), diabetic mellitus (32.7% vs. 22.6%), cerebral-vascular disease (8.2% vs. 3.5%), chronic renal dysfunction (10.5% vs. 3.0%)], and complications [including arrhythmia (8.8% vs. 4.6%), gastrointestinal bleeding (5.0% vs. 0.8%) and shock (8.6% vs. 3.1%)] were all significantly higher, and hyperlipidemia (18.9% vs. 30.6%) was significantly lower (P < 0.05 or P < 0.01) in CAP complicated patients. The 30-day mortality was also significantly higher (32.1% vs. 9.7%, P < 0.01). Multivariate logistic regression analysis identified CAP and chronic renal dysfunction as an independent predictor of short-term mortality [odds ratio (OR) of CAP 3.693, 95% confidence interval (95%CI) 2.340 ~ 5.829, P < 0.01; OR of chronic renal dysfunction 12.608, 95%CI 4.448 ~ 35.739, P < 0.01]. The incidence of CAP complication was higher in AMI patients with higher age.CAP complicated patients were more likely to develop comorbidities/complications, and had higher short-term mortality. CAP was an independent risk factor of short-term mortality.