Hospital-acquired pneumonia (HAP) or nosocomial pneumonia refers to any pneumonia contracted by a patient in a hospital at least 48–72 hours after being admitted. It is thus distinguished from community-acquired pneumonia. It is usually caused by a bacterial infection, rather than a virus.