Purpose: Information about healthcare-associated pneumonia (HCAP) in critically ill patients is scarce. Methods: This prospective study compared clinical presentation, outcomes, microbial etiology, and treatment of HCAP, community-acquired pneumonia (CAP), and immunocompromised patients (ICP) with severe pneumonia admitted to 34 Spanish ICUs. Results: A total of 726 patients with pneumonia (449 CAP, 133 HCAP, and 144 ICP) were recruited during 1 year from April 2011. HCAP patients had more comorbidities and worse clinical status (Barthel score). HCAP and ICP patients needed mechanical ventilation and tracheotomy more frequently than CAP patients. Streptococcus pneumoniae was the most frequent pathogen in all three groups (CAP, 34.2 %; HCAP, 19.5 %; ICP, 23.4 %; p = 0.001). The overall incidence of Gram-negative pathogens, methicillin-resistant Staphylococcus aureus (MRSA), and Pseudomonas aeruginosa was low, but higher in HCAP and ICP patients than CAP. Empirical treatment was in line with CAP guidelines in 73.5 % of patients with CAP, in 45.5 % of those with HCAP, and in 40 % of those with ICP. The incidence of inappropriate empirical antibiotic therapy was 6.5 % in CAP, 14.4 % in HCAP, and 21.8 % in ICP (p < 0.001). Mortality was highest in ICP (38.6 %) and did not differ between CAP (18.4 %) and HCAP (21.2 %). Conclusions: HCAP accounts for one-fifth of cases of severe pneumonia in patients admitted to Spanish ICUs. The empirical antibiotic therapy recommended for CAP would be appropriate for 90 % of patients with HCAP in our population, and consequently the decision to include coverage of multidrug-resistant pathogens for HCAP should be cautiously judged in order to prevent the overuse of antimicrobials.