Skip to content
PubMed This is a summary of 13 peer-reviewed journal articles Updated
Infectious Disease · Acquired Immunodeficiency Syndrome (AIDS)

Preventing Opportunistic Infections (Prophylaxis)

At a Glance

People with advanced HIV/AIDS may need preventive medicines when their CD4 count is low to reduce the risk of opportunistic infections such as PCP, toxoplasmosis, and MAC. Antiretroviral therapy can raise CD4 levels, but a clinician should decide when prophylaxis stops or restarts.

When your immune system is significantly weakened by HIV, you become vulnerable to opportunistic infections (OIs). These are illnesses caused by germs—like viruses, bacteria, fungi, or parasites—that usually don’t cause trouble in people with healthy immune systems but take the “opportunity” to cause disease when the body’s defenses are down [1][2].

Preventing these infections is a cornerstone of HIV care, especially if you have a low CD4 count. This prevention is called prophylaxis [3].

Common Opportunistic Infections

Several specific infections are closely watched in people with advanced HIV:

  • Pneumocystis jirovecii pneumonia (PCP): A serious fungal lung infection that is the most common OI in the U.S. [1][4].
  • Toxoplasmic encephalitis (Toxoplasmosis): An infection caused by a parasite that can affect the brain, often triggered by a reactivation of a previous infection [5].
  • Mycobacterium avium complex (MAC): A bacterial infection that can spread throughout the body, typically only seen in people with very low CD4 counts [6].
  • Candidiasis: A yeast infection (thrush) that can affect the mouth, throat, or esophagus [1].
  • Tuberculosis (TB): A bacterial infection that primarily affects the lungs but can spread elsewhere [1]. You will be tested for latent TB using an IGRA blood test or a skin test; if positive, you will be evaluated for active TB and treated for latent TB as appropriate. Be aware that rifamycin-based TB drugs have major interactions with ART.

CD4 Thresholds for Starting Prophylaxis

Doctors use your CD4 count as a guide to know when to start “preventive” medications. The goal is to start these medicines before you get sick [7].

  • CD4 count below 200 cells/µL, CD4 percentage below 14%, or CD4 100-200 with detectable HIV RNA: At this level, you will likely start prophylaxis for PCP [7][4].
  • CD4 count below 100 cells/µL (with positive Toxoplasma IgG antibodies): If you have evidence of prior exposure to the Toxoplasma parasite, your doctor will start prophylaxis for Toxoplasmosis [5].
  • CD4 count below 50 cells/µL: Primary prophylaxis is generally not recommended if you are immediately starting effective ART. When ART is delayed or not effective, it may be considered for starting MAC prophylaxis [6][8].

Common Prophylaxis Medications

The most important drug in OI prevention is trimethoprim-sulfamethoxazole (TMP-SMX), also known by brand names like Bactrim or Septra [3].

  • TMP-SMX: This is the first-choice medication for preventing both PCP and toxoplasmosis [3][5].
  • Alternatives: If you have a sulfa allergy or cannot tolerate TMP-SMX, your doctor may prescribe dapsone, atovaquone, or inhaled pentamidine [3][9]. Note that aerosolized pentamidine prevents PCP but not toxoplasmosis, and dapsone requires G6PD testing and must be combined with pyrimethamine/leucovorin when toxoplasmosis coverage is needed.
  • MAC Prevention: If needed, MAC is usually prevented with antibiotics like azithromycin or clarithromycin [6].

Medical Emergency Warning: If you develop a severe rash (especially with fever, blistering, peeling, mouth sores, or breathing trouble) while taking TMP-SMX or another prophylactic drug, seek immediate medical advice.

When Can You Stop Prophylaxis?

The best way to stop taking these extra pills is to strengthen your immune system with Antiretroviral Therapy (ART) [1]. As ART controls the virus, your CD4 count will begin to rise.

You can typically stop prophylaxis when:

  1. Your CD4 count rises: For PCP and Toxoplasmosis, this usually means your count stays above 200 cells/µL for at least 3 to 6 months [10][11].
  2. Viral Suppression is achieved: If your viral load is “undetectable,” some doctors may consider stopping prophylaxis earlier—for example, if your CD4 count is between 100 and 200 cells/µL—but this is a specialized decision made based on your specific health history [12][10]. Note that discontinuation and restart criteria differ specifically for each infection and depending on whether it is primary or secondary prophylaxis. An undetectable viral load does not remove OI risk if the CD4 count remains very low.

Never stop taking your prophylaxis medication without your doctor’s approval. If your CD4 count drops again in the future, you may need to restart these preventive treatments to keep your immune system safe [13]. In addition to pills, discuss an individualized vaccination plan with your doctor and practice everyday exposure advice like food/water safety and precautions around soil or animal waste.

Common questions in this guide

What is prophylaxis for opportunistic infections in HIV/AIDS?
Prophylaxis means taking preventive medicine before an opportunistic infection develops. It is used when HIV has weakened the immune system, with the need guided mainly by CD4 count, CD4 percentage, viral load, and the infection being prevented.
When is Pneumocystis pneumonia prophylaxis recommended for people with HIV?
Pneumocystis pneumonia, also called PCP, prophylaxis is generally recommended when the CD4 count is below 200 cells/µL, the CD4 percentage is below 14%, or the CD4 count is 100–200 with detectable HIV RNA. A clinician should confirm the plan using your full medical history and medication list.
Can TMP-SMX prevent both PCP and toxoplasmosis?
Yes. Trimethoprim-sulfamethoxazole (TMP-SMX), sold as Bactrim or Septra, is the preferred medicine for preventing both infections when it is safe for you to take. The need for toxoplasmosis prevention also depends on a positive Toxoplasma IgG test and a very low CD4 count.
What can I take if I have a sulfa allergy?
Dapsone, atovaquone, or inhaled pentamidine may be alternatives for PCP prevention, depending on your health history. Pentamidine does not prevent toxoplasmosis, and dapsone requires G6PD testing; additional medicines may be needed if toxoplasmosis coverage is required.
When can I stop opportunistic infection prophylaxis after starting ART?
For PCP and toxoplasmosis, prophylaxis can often be stopped after the CD4 count has remained above 200 cells/µL for at least 3 to 6 months, but criteria differ by infection and by whether prevention is primary or secondary. An undetectable viral load does not eliminate risk when the CD4 count is still very low, so do not stop without clinician approval.
Is MAC prophylaxis needed if my CD4 count is below 50?
Not always. Primary MAC prophylaxis is generally not recommended when effective ART is started immediately, but it may be considered when ART is delayed or not working effectively. Your clinician will decide based on your treatment plan and immune recovery.
What should I do if I develop a severe rash while taking prophylaxis?
Seek immediate medical advice for a severe rash, especially if it occurs with fever, blistering, peeling skin, mouth sores, or breathing trouble. These can signal a serious reaction to TMP-SMX or another medicine.

Questions to Ask Your Doctor

Curated prompts to bring to your next appointment.

  1. 1.What is my current CD4 count and CD4 percentage, and based on those, which prophylactic medications do I need to start?
  2. 2.Since I am starting ART, at what point do you anticipate we can safely stop my prophylaxis medications?
  3. 3.If I have a sulfa allergy, what is the best alternative to TMP-SMX for preventing PCP and toxoplasmosis?
  4. 4.Are there any symptoms of these infections I should watch for while I am on prophylaxis, especially if my CD4 count is still very low?

Questions For You

Tap a prompt to share your answer — we'll use it plus this page's context to start a tailored conversation.

References

References (13)
  1. 1

    Care of Patients With HIV Infection: Medical Complications and Comorbidities.

    Bolduc P, Roder N, Colgate E, Cheeseman SH

    FP essentials 2016; (443()):16-22.

    PMID: 27092563
  2. 2

    Incidence of AIDS-Defining Opportunistic Infections in a Multicohort Analysis of HIV-infected Persons in the United States and Canada, 2000-2010.

    Buchacz K, Lau B, Jing Y, et al.

    The Journal of infectious diseases 2016; (214(6)):862-72 doi:10.1093/infdis/jiw085.

    PMID: 27559122
  3. 3

    Pneumocystis jirovecii: a review with a focus on prevention and treatment.

    Weyant RB, Kabbani D, Doucette K, et al.

    Expert opinion on pharmacotherapy 2021; (22(12)):1579-1592 doi:10.1080/14656566.2021.1915989.

    PMID: 33870843
  4. 4

    Cutaneous Pneumocystis Jirovecii Infection in an Allogeneic Stem Cell Transplant Recipient.

    Sood N, Vadnerkar A, Kodali M, Hamacher LK

    European journal of case reports in internal medicine 2024; (11(7)):004615 doi:10.12890/2024_004615.

    PMID: 38984179
  5. 5

    Impact of alternative treatment approach for cerebral toxoplasmosis among HIV/AIDS patients from a resource-poor setting in Burkina Faso

    Bamba S, Zoungrana J, Nikièma Z, et al.

    Annals of parasitology 2017; (63(3)):173–181 doi:10.17420/ap6303.103.

    PMID: 29274210
  6. 6

    Drug resistance and pathogenic spectrum of patients coinfected with nontuberculous mycobacteria and human-immunodeficiency virus in Chengdu, China.

    Wang DM, Liao Y, Li QF, et al.

    Chinese medical journal 2019; (132(11)):1293-1297 doi:10.1097/CM9.0000000000000235.

    PMID: 30925547
  7. 7

    The Impact of Absolute CD4 Count and Percentage Discordance on Pneumocystis Jirovecii Pneumonia Prophylaxis in HIV-Infected Patients.

    Anyimadu H, Pingili C, Sivapalan V, et al.

    Journal of the International Association of Providers of AIDS Care 2018; (17()):2325958218759199 doi:10.1177/2325958218759199.

    PMID: 29534652
  8. 8

    Incidence, Long-Term Outcomes, and Healthcare Utilization of Patients With Human Immunodeficiency Virus/Acquired Immune Deficiency Syndrome and Disseminated Mycobacterium avium Complex From 1992-2015.

    Collins LF, Clement ME, Stout JE

    Open forum infectious diseases 2017; (4(3)):ofx120 doi:10.1093/ofid/ofx120.

    PMID: 28748197
  9. 9

    Antibiotic prophylaxis in immunosuppressed patients - Missed opportunities from trimethoprim-sulfamethoxazole allergy label.

    Lee WI, Lam L, Bacchi S, et al.

    The World Allergy Organization journal 2024; (17(1)):100856 doi:10.1016/j.waojou.2023.100856.

    PMID: 38235260
  10. 10

    Discontinuing Pneumocystis jirovecii Pneumonia Prophylaxis in HIV-Infected Patients With a CD4 Cell Count <200 cells/mm3.

    Sidhu VK, Foisy MM, Hughes CA

    The Annals of pharmacotherapy 2015; (49(12)):1343-8 doi:10.1177/1060028015605113.

    PMID: 26358129
  11. 11

    Withholding Primary Pneumocystis Pneumonia Prophylaxis in Virologically Suppressed Patients With Human Immunodeficiency Virus: An Emulation of a Pragmatic Trial in COHERE.

    Atkinson A, Zwahlen M, Barger D, et al.

    Clinical infectious diseases : an official publication of the Infectious Diseases Society of America 2021; (73(2)):195-202 doi:10.1093/cid/ciaa615.

    PMID: 32448894
  12. 12

    No need for secondary Pneumocystis jirovecii pneumonia prophylaxis in adult people living with HIV from Europe on ART with suppressed viraemia and a CD4 cell count greater than 100 cells/µL.

    Atkinson A, Miro JM, Mocroft A, et al.

    Journal of the International AIDS Society 2021; (24(6)):e25726 doi:10.1002/jia2.25726.

    PMID: 34118121
  13. 13

    Prescription of Pneumocystis Jiroveci Pneumonia Prophylaxis in HIV-Infected Patients.

    Lin X, Garg S, Mattson CL, et al.

    Journal of the International Association of Providers of AIDS Care 2016; (15(6)):455-458 doi:10.1177/2325957416667486.

    PMID: 27629868

This page explains prophylaxis for opportunistic infections in HIV/AIDS for informational purposes only and does not constitute medical advice. Your HIV clinician should choose, adjust, or stop preventive medicines based on your CD4 count, viral load, allergies, and other medicines.

Get notified when new evidence is published on AIDS.

We monitor PubMed for new peer-reviewed studies on this topic and email a short summary when something meaningful changes.