This study aimed to estimate the rate of and risk factors for nosocomial pneumonia of patients admitted to hospitals in Taif, Saudi Arabia. A case–control study was conducted of 211 discharged patients with confirmed pneumonia and 633 controls without pneumonia and a review was made of hospital records during 1999–2003. Multiple logistic regression showed that duration of hospital stay, unit of admission, chronic obstructive pulmonary diseases, coma, nasogastric tube, endotracheal tube, debilitating diseases and mechanical ventilation were independently associated with increased risk of pneumonia. The mean incidence of overall nosocomial infection in the period 1999–2003 was 3 per 100 discharged patients, while the mean incidence of nosocomial pneumonia was 0.88.