MSD Manual

Please confirm that you are not located inside the Russian Federation

honeypot link

Pneumonia in Immunocompromised People


Sanjay Sethi

, MD, University at Buffalo SUNY

Last full review/revision Dec 2020| Content last modified Dec 2020
Click here for the Professional Version

Pneumonia is infection of the lungs. Pneumonia in people whose immune system is weakened or impaired (for example, by acquired immunodeficiency syndrome [AIDS], cancer, organ transplantation, or the use of certain drugs) is often caused by different organisms than those that cause pneumonia in healthy people.

  • Pneumonias due to microorganisms that do not often cause disease in healthy people can occur in people who have a weakened immune system.

  • Symptoms vary but may include shortness of breath, cough, and fever.

  • X-rays of the chest are often combined with examinations of sputum and blood samples to make the diagnosis.

  • Antibiotics or antifungal or antiviral drugs are used to treat this pneumonia, and any immune system problem is treated.

Immunocompromised people have a weakened or impaired immune system. The immune system defends the body against microorganisms that can cause infection.

In people with a weakened immune system, pneumonia may be caused by many microorganisms, including those that do not usually cause pneumonia. Many conditions may cause weakness of the immune system, including

  • Cancer and the chemotherapy drugs used to treat cancer

  • Defects in white blood cells

  • Diseases, such as AIDS

  • Certain drugs (such as corticosteroids, chemotherapy drugs, and drugs used to treat autoimmune or connective tissue disorders)

(See also Overview of Pneumonia.)


In people with a weakened immune system, pneumonia may be caused by the same microorganisms that cause community-acquired pneumonia but can be caused by unusual or uncommon organisms.

Pneumocystis jirovecii is a common fungus that may reside harmlessly in the lungs of healthy people. It usually causes pneumonia only when the body’s defenses are weakened because of AIDS, organ transplantation, cancer, or use of drugs that alter the immune system. Often, P. jirovecii pneumonia is the first indication that a person with human immunodeficiency virus (HIV) infection has developed AIDS.

Other fungi such as Aspergillus and Candida, bacteria such as Staphylococcus aureus, Streptococcus pneumoniae, and Haemophilus influenzae, and viruses such as cytomegalovirus and herpes simplex virus also cause pneumonia in people with a weakened immune system.


Symptoms of pneumonia in people who have a weakened immune system may be the same as those for community-acquired pneumonia and include the following:

  • A general feeling of weakness (malaise)

  • Cough that produces sputum (thick or discolored mucus)

  • Shortness of breath

  • Fever

  • Chills

  • Chest pain

These symptoms can develop rapidly or slowly.

Most people who have P. jirovecii pneumonia develop a fever, shortness of breath, and a dry cough, often slowly. The lungs may not be able to deliver sufficient oxygen to the blood, leading to shortness of breath that is sometimes severe.


  • Chest x-ray

  • Microscopic examination of a sputum (thick or discolored mucus) sample

  • Blood cultures

  • Pulse oximetry

The diagnosis of pneumonia in a person who has a weakened immune system is based on the person’s symptoms, the results of a chest x-ray or CT scan, and the results of sputum and blood tests.

Chest x-rays may be normal or may show signs of infection.

Doctors obtain sputum samples by giving a vapor treatment that causes the person to cough deeply (inducing sputum production) or insert a bronchoscope (small flexible tube equipped with a camera) into the airways. Sputum samples obtained by inducing a cough and particularly those obtained with a bronchoscope are less likely to contain saliva and are more likely than expectorated sputum samples to allow doctors to identify the organism causing pneumonia.

Doctors usually take a sample of blood so they can try to grow (culture) the bacteria in the laboratory and identify it.

People who have a weakened immune system may have low levels of oxygen in their blood. Doctors can measure levels of oxygen in the blood without taking a blood sample by placing a sensor on a finger or an earlobe. This test is called pulse oximetry.


Even when the pneumonia is treated, the overall death rate is higher than that for generally healthy people with community-acquired pneumonia because infections are much harder to treat in people with immune system problems and because these people tend to be much sicker, even before pneumonia begins.

The overall death rate for people who have P. jirovecii pneumonia is high.


Doctors often give treatments to help bolster the person's immune system and prevent pneumonia. For example, in people whose immune system has been weakened by cancer treatment, doctors may give a drug called granulocyte-colony stimulating factor to enhance the production of white blood cells (the type that fight infection).

People who are at risk of pneumonia caused by bacteria should receive vaccinations against pneumococcus and Haemophilus influenzae.

The combination antibiotic trimethoprim/sulfamethoxazole can be used to help prevent P. jirovecii pneumonia in people at risk. This drug’s side effects, which are particularly common among people who have AIDS, include rashes, a reduced number of infection-fighting white blood cells, and fever. Alternative preventive drug treatments are dapsone or pentamidine.


  • Antibiotics, antivirals, or antifungals

  • Treatment of any immune system problem

Treatment of pneumonia depends on the

  • Specific immune system problem

  • Severity of illness

  • Organisms that may be causing infection

Doctors usually give an antibiotic that is effective against many organisms (a broad-spectrum antibiotic). If the person's condition does not improve, doctors may add an additional drug that is effective against viruses or fungi.

Therapies to improve the immune system are also important for the treatment of pneumonia in people with immune system problems. Drugs that suppress the immune system (such as chemotherapy drugs or drugs used to treat autoimmune disorders) should be temporarily stopped until the infection has resolved.

People who have P. jirovecii pneumonia are given the combination antibiotic trimethoprim/sulfamethoxazole Alternative drugs are dapsone, atovaquone, clindamycin, and pentamidine. Some people are also given the corticosteroid prednisone.

NOTE: This is the Consumer Version. DOCTORS: Click here for the Professional Version
Click here for the Professional Version
Others also read
Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID

Test your knowledge

Overview of Environmental Lung Diseases
Environmental lung diseases are caused by harmful particles, mists, vapors, or gases that are inhaled, usually while people work. Which of the following factors determines where in the airways or lungs a harmful inhaled particle ends up? 
Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID

Also of Interest

Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID
Download the Manuals App iOS ANDROID