For general information only. This library does not replace advice, diagnosis or treatment from a qualified health professional. In an emergency, call 911.

Library / Conditions

Bacterial pneumonia

Bacterial pneumonia is a lung infection caused by bacteria, which makes the small air sacs fill with fluid or pus and causes cough, fever and trouble breathing.

Clinician view: includes diagnostic criteria, management and safety detail.

Overview

Bacterial pneumonia is an infection of the lungs caused by bacteria (germs). Pneumonia means the tiny air sacs deep in your lungs, called alveoli, become inflamed (swollen and irritated) and fill with fluid or pus. This makes it harder for oxygen to pass from the air you breathe into your blood. Pneumonia is one of the most common reasons adults and children are admitted to hospital, and bacteria are a leading cause.

Pneumonia can also be caused by viruses (such as flu or COVID-19) and, less often, fungi. Bacterial pneumonia matters because it usually needs antibiotics. It can be mild enough to treat at home, or serious enough to need hospital care. Most people recover fully with the right treatment, but it can be dangerous for babies, older adults and people with long-term health problems.

Doctors often group pneumonia by where you caught it. Community-acquired pneumonia starts in everyday life. Hospital-acquired pneumonia starts after at least two days in hospital, and it is often caused by different, harder-to-treat bacteria.

Types and common causes

Many different bacteria can cause pneumonia. The most common ones include:

  • Pneumococcal pneumonia: caused by Streptococcus pneumoniae. This is the most common cause of bacterial pneumonia in adults, and vaccines can help prevent it.
  • Mycoplasma pneumonia: caused by Mycoplasma pneumoniae. It is often milder and is sometimes called "walking pneumonia" because people may stay up and about. It is common in school-age children and young adults.
  • Chlamydial pneumonia: caused by Chlamydia pneumoniae (a different germ from the one that causes the sexually transmitted infection). It is usually mild.
  • Staphylococcal pneumonia: caused by Staphylococcus aureus, including the antibiotic-resistant type called MRSA. It can be severe and sometimes follows the flu.
  • Other causes: Haemophilus influenzae, Legionella (Legionnaires' disease, spread through contaminated water systems), and gut bacteria such as Klebsiella, which mostly affect people who are in hospital or already unwell.

Rickettsial pneumonia is a rare type. One example is Q fever, caused by the germ Coxiella burnetii, which is usually linked to contact with farm animals such as sheep, goats and cattle.

Symptoms

Symptoms can come on quickly over a day or two, or more slowly over several days. Common symptoms include:

  • a cough, often bringing up thick yellow, green or rust-coloured mucus (phlegm)
  • fever, sweating and shaking chills
  • feeling short of breath, or breathing faster than usual
  • sharp chest pain that gets worse when you breathe in deeply or cough
  • feeling very tired and weak
  • loss of appetite, nausea or vomiting
  • a fast heartbeat

Older adults may not have a fever or a bad cough. Instead, they may seem confused, become drowsy, or have a sudden fall. Babies and young children may breathe fast, grunt, look pale or floppy, or feed poorly. Walking pneumonia often causes a dry cough, headache, sore throat and tiredness that slowly build up.

How it spreads and risk factors

The bacteria that cause pneumonia often live harmlessly in the nose and throat. Pneumonia happens when they get down into the lungs and your body's defences cannot clear them. Some bacteria spread through droplets when people cough or sneeze. Others reach the lungs when food, drink or stomach contents are breathed in by accident, which is called aspiration.

Anyone can get bacterial pneumonia, but your risk is higher if you:

  • are under 2 or over 65 years old
  • smoke, or drink a lot of alcohol
  • have a long-term lung condition such as COPD, asthma or bronchiectasis
  • have heart disease, diabetes, kidney or liver disease
  • have a weak immune system (the body's defence against infection), for example from cancer treatment, HIV, an organ transplant or medicines such as long-term steroids
  • have trouble swallowing, for example after a stroke or with Parkinson's disease
  • have recently had the flu or another viral infection
  • are in hospital, especially on a breathing machine (ventilator), or live in a care home

Diagnosis

A doctor or nurse will ask about your symptoms and listen to your chest with a stethoscope. Crackling or bubbling sounds can be a sign of pneumonia. They will also check your temperature, breathing rate, pulse, blood pressure and oxygen level.

Tests that may be used include:

  • Pulse oximetry: a small clip on your finger that measures the oxygen in your blood.
  • Chest X-ray: shows areas of infection in the lungs and helps confirm pneumonia.
  • Blood tests: to look for signs of infection and check how your kidneys and other organs are working.
  • Sputum test: a sample of the mucus you cough up is checked in a lab to find the bacteria and which antibiotics will work.
  • Urine tests: can detect some bacteria, such as pneumococcus and Legionella.
  • Blood cultures: to see if bacteria have spread into the blood, usually done in hospital.

Many people with mild pneumonia are diagnosed and treated based on an examination alone, without needing every test.

Treatment

Bacterial pneumonia is treated with antibiotics, medicines that kill bacteria or stop them growing. The choice depends on how sick you are, your age, other health conditions, allergies, and which germs are common where you live.

Treatment at home

Most healthy people with mild pneumonia can take antibiotic tablets at home. Common choices include amoxicillin (a penicillin), doxycycline (a tetracycline), or a macrolide such as azithromycin or clarithromycin. People with other health problems may be given a combination, or a medicine such as cefuroxime or cefpodoxime (cephalosporins). A fluoroquinolone such as levofloxacin or moxifloxacin may be used in some cases, for example with certain allergies. Newer antibiotics, such as lefamulin and omadacycline, are available in some countries and may be used when other choices are not suitable.

Take every dose of your antibiotic exactly as prescribed, and finish the course unless your clinician tells you otherwise. You should start to feel better within 2 to 3 days. If you are not improving, or you feel worse, contact your clinician.

Treatment in hospital

If your pneumonia is severe, you may need hospital care. You may receive antibiotics through a drip into a vein, such as ceftriaxone or cefotaxime, often with a second antibiotic. For hospital-acquired pneumonia or resistant germs like MRSA, doctors may use medicines such as cefepime, ceftazidime, vancomycin or linezolid. You may also get oxygen, fluids, and, in the most serious cases, help with breathing in an intensive care unit.

Easing symptoms

Acetaminophen (paracetamol) or ibuprofen can help with fever and chest pain. Check with your pharmacist or clinician first if you have kidney problems, stomach ulcers, or take blood thinners, as ibuprofen may not be safe for you. Ask your pharmacist before using cough medicines, as coughing helps clear mucus from your lungs.

Recovery and self-care

Getting over pneumonia takes time, even once the antibiotics have started working. The fever usually settles within the first week. Chest pain and mucus then ease gradually over the following weeks, but a cough and some breathlessness can hang on for a month or more. Feeling tired and low on energy is very common and may last a few months, especially for older adults or people who needed hospital care. Everyone recovers at their own pace, so be patient with yourself.

To help yourself recover:

  • rest, and return to normal activities gradually
  • drink plenty of fluids to avoid dehydration
  • do not smoke, and avoid smoky places
  • eat small, regular meals, even if your appetite is low
  • cover coughs and sneezes and wash your hands often to protect others
  • go to any follow-up appointments your care team arranges

Complications and outlook

Most people with bacterial pneumonia recover well, especially when treatment starts early. Sometimes, though, it can lead to complications, such as:

  • sepsis: a life-threatening reaction when the body's response to infection starts to damage its own organs
  • pleural effusion or empyema: fluid or pus collecting between the lung and the chest wall, which may need to be drained
  • lung abscess: a pocket of pus inside the lung
  • respiratory failure: when the lungs cannot get enough oxygen into the blood
  • a worsening of existing heart or lung conditions

The risk of serious illness is higher in older adults, very young children and people with other health conditions. Your clinician can talk to you about what to expect in your situation.

Prevention

You can lower your chance of getting bacterial pneumonia by:

  • getting vaccinated: pneumococcal vaccines protect against the most common cause. Children receive them as part of routine childhood vaccines, and they are recommended for older adults and people with certain health conditions. The yearly flu vaccine, COVID-19 vaccines and, for babies, the Hib vaccine also help, because these infections can lead to bacterial pneumonia.
  • not smoking: smoking damages the lungs' natural defences
  • washing your hands often with soap and water or hand sanitizer
  • keeping long-term conditions such as diabetes, COPD and heart disease well managed
  • good mouth care and help with swallowing problems, which reduce the risk of aspiration

Ask your clinician or pharmacist which vaccines are right for you.

In Canada

In Canada, the National Advisory Committee on Immunization (NACI) advises on pneumococcal vaccines for children, older adults and people at higher risk. Publicly funded vaccines and eligibility vary by province and territory; ask your pharmacist, clinician or local public health unit.

Diagnosis and severity assessment

Diagnose pneumonia clinically (acute lower respiratory symptoms, fever, focal chest signs) and confirm with chest radiography where available; lung ultrasound or CT can help when the radiograph is equivocal. S. pneumoniae remains the leading bacterial cause of community-acquired pneumonia (CAP); others include H. influenzae, M. pneumoniae, C. pneumoniae, Legionella, S. aureus (including post-influenza MRSA) and Enterobacterales. A pathogen is not identified in many cases.

Assess severity with CURB-65 (CRB-65 in primary care) or the Pneumonia Severity Index, alongside clinical judgement, oxygenation and social factors. Use the IDSA/ATS major and minor criteria to identify severe CAP needing ICU care. For inpatients with severe CAP, or with risk factors for MRSA or Pseudomonas, obtain blood and sputum cultures; urinary pneumococcal and Legionella antigen testing is reasonable in severe disease. Test for influenza and SARS-CoV-2 when circulating. Procalcitonin should not be used to decide whether to start antibiotics in radiographically confirmed CAP.

Management

The 2019 ATS/IDSA CAP guideline recommends, for healthy outpatients, amoxicillin, doxycycline, or a macrolide only where pneumococcal macrolide resistance is below 25%. Outpatients with comorbidities: amoxicillin-clavulanate or a cephalosporin (cefuroxime, cefpodoxime) plus a macrolide or doxycycline, or a respiratory fluoroquinolone (levofloxacin, moxifloxacin) as monotherapy. Non-severe inpatients: a beta-lactam (e.g. ceftriaxone, cefotaxime) plus a macrolide, or a respiratory fluoroquinolone. Severe CAP: beta-lactam plus macrolide, or beta-lactam plus fluoroquinolone. Add MRSA cover (vancomycin or linezolid) or antipseudomonal cover (e.g. piperacillin-tazobactam, cefepime, ceftazidime) only with prior respiratory isolation or locally validated risk factors, and de-escalate on culture results. NICE NG138 gives UK-adapted choices. Treat for a minimum of 5 days and until clinically stable; switch to oral therapy once stable.

Hospital-acquired and ventilator-associated pneumonia: follow the 2016 IDSA/ATS guideline, with empiric choices guided by local antibiograms and MRSA or multidrug-resistance risk, and a typical 7-day course.

Cautions: fluoroquinolones carry warnings for tendinopathy, QT prolongation, dysglycaemia, neuropsychiatric effects and aortic aneurysm, and increase C. difficile risk; macrolides prolong QT; linezolid can cause myelosuppression and serotonin syndrome with serotonergic drugs; tetracyclines are generally avoided in pregnancy and young children. Corticosteroids are not routine in non-severe CAP; evidence supports hydrocortisone in selected severe CAP, but avoid in influenza.

Monitoring and red flags: review at 48 to 72 hours. Failure to improve should prompt assessment for parapneumonic effusion or empyema, lung abscess, resistant or atypical organisms, or an alternative diagnosis. Routine follow-up imaging is not needed if symptoms resolve; consider repeat imaging for persistent symptoms or patients at higher risk of lung cancer. Offer pneumococcal and influenza vaccination and smoking cessation.

When to get medical help

See a doctor or nurse soon, the same day if you can, if you have a cough with fever, chills or coloured mucus, chest pain when breathing, or a cough that is not getting better after 3 weeks. Contact them again if you have started antibiotics and you are not improving after 2 to 3 days, or you are getting worse.

Go to the emergency department or call emergency services if you or someone you care for:

  • is struggling to breathe, or is too breathless to speak in full sentences
  • has blue, grey or pale lips, skin or tongue
  • is newly confused, very drowsy or hard to wake
  • has chest pain that does not go away
  • has cold, blotchy skin, a very fast heartbeat, or is passing very little urine
  • is a baby or young child who is breathing very fast, grunting, has the skin pulling in under the ribs with each breath, or is floppy or not feeding

In an emergency, call 911.

References

  1. U.S. National Library of Medicine. MeSH: Bacterial Pneumonia. meshb.nlm.nih.gov
  2. MedlinePlus: Pneumonia. medlineplus.gov/pneumonia.html
  3. NHLBI: Pneumonia. nhlbi.nih.gov/health/pneumonia
  4. ATS/IDSA: Diagnosis and treatment of adults with community-acquired pneumonia (2019). doi.org/10.1164/rccm.201908-1581ST
  5. IDSA/ATS: Management of adults with hospital-acquired and ventilator-associated pneumonia (2016). doi.org/10.1093/cid/ciw353
  6. NICE: Pneumonia (community-acquired): antimicrobial prescribing (NG138). nice.org.uk/guidance/ng138