Objective Patients with rheumatoid arthritis (RA) experience an increased risk of infections, but the prognosis of infections is unclear. We examined if patients with RA have worse outcomes from pneumonia than non-RA individuals. Methods In a population-based cohort study, we computed 90-day mortality rates and crude and adjusted HRs comparing pneumonia patients with and without RA. Among patients with RA, we evaluated prognostic effects of RA medications including prednisolone and disease activity as assessed by C reactive protein (CRP) or platelet levels measured 30-180 days before admission to avoid any influence from the subsequent infection. Results Among 52 577 patients hospitalised for the first time with pneumonia, 1220 (2.3%) had RA. The 90-day mortality was 19.9% for patients with RA and 18.9% for non-RA patients (adjusted 90-day HR of 1.05 (95% CI 0.92 to 1.19)). Compared with CRP levels <8 mg/L, CRP levels ≥20 mg/L predicted increased mortality in patients with RA with adjusted 90-day HRs of 4.98 (95% CI 2.19 to 11.36). Compared with methotrexate monotherapy, both prednisolone (HR 1.43 (95% CI 0.91 to 2.22)) and no RA therapy (HR 1.35 (95% CI 0.85 to 2.14)) tended to increase 90-day mortality. Compared with patients who used prednisolone and had low CRP levels, high CRP predicted increased mortality both in patients who used prednisolone (HR 3.09, 95% CI 1.25 to 7.65) and those who did not (HR 2.35, 95% CI 0.94 to 5.87). Conclusions Overall, RA does not increase mortality following hospitalisation for pneumonia. However, high RA disease activity prior to admission predicts increased pneumonia mortality in patients regardless of prednisolone use.