University of California, San Francisco Logo

University of California, San Francisco | About UCSF | Search UCSF | UCSF Medical Center

Home > Public/Patient > Just Diagnosed > Opportunistic Infections
Opportunistic Infections and AIDS-Related Cancers
gray line
Why it's important to get an early diagnosis
transparent image
transparent image
Common types of illnesses
transparent image
transparent image
transparent imageCandidiasis (thrush)
transparent image
transparent imageCervical cancer (for women)
transparent image
transparent imageCoccidioidomycosis
transparent image
transparent imageCryptococcosis
transparent image
transparent imageCryptosporidiosis
transparent image
transparent imageCytomegalovirus (CMV)
transparent image
transparent imageHerpes simplex virus
transparent image
transparent imageHerpes zoster (shingles)
transparent image
transparent imageHistoplasmosis
transparent image
transparent imageHIV dementia
transparent image
transparent imageHIV wasting syndrome
transparent image
transparent imageIsosporiasis
transparent image
transparent imageKaposi sarcoma
transparent image
transparent imageLymphomas
transparent image
transparent imageMycobacterium avium complex (MAC)
transparent image
transparent imagePneumocystis pneumonia (PCP)
transparent image
transparent imagePneumonia, recurrent
transparent image
transparent imageProgressive multifocal leukoencephalopathy (PML)
transparent image
transparent imageSalmonella septicemia, recurrent
transparent image
transparent imageToxoplasmosis
transparent image
transparent imageTuberculosis (TB)
transparent image
CD4 counts and infections
transparent image
transparent image
AIDS-defining illnesses
transparent image
transparent image
Preventing OIs
transparent image
transparent image
transparent imageSexual exposures
transparent image
transparent imageInjection drug use
transparent image
transparent imageJob exposure
transparent image
transparent imagePet exposure
transparent image
transparent image
transparent imageGeneral
transparent image
transparent imageCats
transparent image
transparent imageBirds
transparent image
transparent imageOthers
transparent image
transparent image
transparent imageCautions about food and water
transparent image
transparent imageCautions about travel
transparent image
transparent image

HIV weakens your immune system, leaving you vulnerable to certain infections and cancers. The infections are called "opportunistic" because they take the opportunity to attack you when your immune system is weak. The cancers are called "AIDS related" because they appear mostly in people who have advanced, later-stage HIV infection, known as AIDS.

Most people who die of AIDS do not die from the virus itself. They die from opportunistic infections (or "OIs"). Often, people are infected with the OI long before they become infected with HIV. Their functioning immune system keeps the OI under control, so they don't have any symptoms of the infection. Once HIV damages their immune system enough, the OI becomes uncontrolled and makes them sick. If you have HIV, you can take antibiotics to prevent the OI from causing disease. For example, one common opportunistic infection is Pneumocystis jiroveci pneumonia (also called PCP). Most people already have the microbe that causes PCP in their body, but it doesn't make them sick. An HIV-positive person, however, may need to take antibiotics to keep from getting very sick.

Why it's important to get an early diagnosis

It is important to catch the early symptoms of OIs and AIDS-related cancers before they take hold in various organs of the body, such as the lungs and brain. The sooner your doctor can diagnose and treat the condition, the more likely you are to make a full recovery. This means you need to keep track of your symptoms and report them to your doctor. Plan on having checkups regularly, at least every 3 months.

Studies are increasingly showing a benefit of starting HIV medicines even at high CD4 cell counts--starting early may help prevent some damage that is irreversible and may reduce the risk of damage to organs like the brain, heart, and liver. If you have chosen not to start HIV medications, Also, it is important to have your CD4 count checked every 3 to 4 months. OIs and AIDS-related cancers tend to occur more commonly in people with lower CD4 counts, and checking your CD4 cell count will allow you to begin necessary prophylactic medications to reduce your risk of opportunistic infections like PCP and mycobacterium Avium and readdress HIV treatment.

Common types of illnesses

OIs can be caused by viruses, bacteria, fungus, even parasites. Common opportunistic infections are:

Recurrent bacterial Pneumonia
Tuberculosis, or TB
Candidiasis, or thrush (yeast infections of the mouth, esophagus and/or vagina)
Coccidioidomycosis ("cocci")
Cryptococcosis (fungal infection that can cause meningitis)
Pneumocystis jiroveci, or PCP (a type of pneumonia)
Toxoplasmosis (parasite that infects the brain)
Cytologmegalovirus (CMV) (virus that infects the eye and colon)
Herpes zoster (shingles)
Severe or recurrent herpes infections
Common AIDS-related cancers are:
Anal Cancer
Cervical Cancer
Kaposi sarcoma, or KS
Other AIDS-related syndromes:
HIV dementia (confusion)
Wasting syndrome (severe weight loss)

What follows are descriptions of some of these illnesses.

Candidiasis (thrush)

Candidiasis (or thrush) is a fungal infection of the mouth or lungs. Most people already have the Candida fungus in their body, but the body keeps it in check. Someone whose immune system is weakened is more likely to develop problems.

Some people show no symptoms, but for those who have them, symptoms can include:

white patches on the tongue
smooth red areas on the back of the tongue
painful areas in the mouth
changes in taste
sensitivity to spicy foods
decreased appetite
pain or difficulty swallowing
yeast infection of the vagina (vaginal itching and white discharge)

Treatments for thrush include oral drugs (suspensions) that you swish around in your mouth and swallow as well as oral antifungal medications.

If you are taking drugs for thrush or a yeast infection, be sure to:

brush your teeth after each meal;
rinse your mouth of all food before using either lozenges or suspension;
avoid hurting your mouth: use a soft toothbrush; avoid foods and drinks that are too hot or too spicy.
Cervical cancer (for women)

Cervical cancer often is caused by the same virus that causes anal and genital warts. The virus is called human papilloma virus (or HPV). Safer sex may help reduce the risk of this infection, but many women who are infected with HPV never had genital warts.

In the early stage, there are often no symptoms. Some women, however, may notice bleeding between their periods or spots of blood after sex. Women should get regular exams with pap smears to check for cervical cancer.


This is a caused by a fungus present in soil in the southwestern United States. Risk of infection is highest in Kern and Tulare counties and the San Joaquin Valley in California.

The fungus is inhaled from dust and dirt carried in the air or wind, rather than passed from person to person. Most people don't have symptoms. Others will feel like they have the flu, sometimes with chest pain and a cough. Infection can lead to meningitis, including headache, fever, and altered mental states.

Treatment with antifungal drugs usually is given for life to prevent the infection from returning, even despite effective treatment with HIV medications. Sometimes surgery is required to remove infected tissue. The seriousness of the disease depends on what part or parts of the body the fungus has infected.


This fungus is present in soil, usually where there are bird droppings, particularly those of pigeons. It can be passed through the air or wind. It's important to avoid handling birds, including pets, and to avoid areas with lots of bird droppings.

The fungus can infect different organs, such as the lung, heart, and central nervous system. Symptoms vary, depending on where the infection occurs. In the lung, for example, symptoms can include:

shortness of breath

This infection is very serious. It can lead to meningitis (infection around the brain) and pneumonia. Drugs are available to treat this infection but antibiotic treatment is necessary until the immune system has improved on HIV medications.


This parasite is found in the feces of many animals, including humans. It can contaminate drinking water.

To avoid infection from people, avoid contact with feces (diapers, sex involving direct oral-anal contact). Try to avoid accidentally swallowing water when swimming in pools, rivers, or lakes. Do not drink from streams. Drink bottled water or use filters on tap water (look for "submicron" filters, which will filter out this parasite). Avoid eating raw oysters as they can carry eggs of cryptosporidia.

Symptoms of this infection include:

persistent watery diarrhea
abdominal pain
loss of appetite
weight loss

The main treatment for cryptosporidiosis is effective HIV treatment. In conjunction with ART, treatment with antimicrobials can hasten clearance and improve resolution of diarrhea. No antimicrobial has been shown to be effective in the absence of HIV treatment.

Cytomegalovirus (CMV)

Cytomegalovirus (or CMV) is passed by close contact through sex and through saliva, urine, and other body fluids. It can be passed from mother to child during pregnancy and by breast-feeding. If you are not infected, safer sex may help prevent infection.

Many people are infected with this virus, though they have no symptoms. In HIV-positive people, the infection can be extremely serious. Symptoms can include:

blind spots in vision, loss of peripheral vision
headache, difficulty concentrating, sleepiness
mouth ulcers
pain in the abdomen, bloody diarrhea
fever, fatigue, weight loss
shortness of breath
lower back pain
confusion, apathy, withdrawal, personality changes

Drugs are available to keep symptoms of the infection under control. Anti-HIV drugs can improve the condition, too. If you haven't started taking drugs for HIV, it may be best to wait until you have been on treatment for CMV for a few weeks.

Treatment can prevent further loss of vision but cannot reverse existing damage. If you experience any vision problems, tell your provider immediately.

Herpes simplex virus

Herpes simplex is caused by a virus. Symptoms include red, painful sores on the mouth ("fever blisters"), genitals, or anal area. Genital herpes is passed through sexual contact. Herpes on the mouth is easily spread through kissing. It can be spread to the genitals through oral sex. Although less common, the virus can be spread even if you don't have blisters. Safer sex can decrease the risk of infection.

Drugs are available to help herpes blisters heal, but there's no cure. Outbreaks may occur periodically for the rest of your life. Suppressive therapy with daily antiviral treatment can help reduce the number of outbreaks.

For more information on herpes, call the HELP line in Atlanta at 404-294-6364 or the National Herpes Hotline at 919-361-8488.

Herpes zoster (shingles)

Shingles is caused by a virus, the same one that causes chickenpox. People with shingles usually had chickenpox as a child, and shingles is caused by reactivation of the herpes virus.

Symptoms can include:

painful skin blisters on one side of the face or body
some vision loss

The skin blisters can be extremely painful. Treatment is available to help the blisters heal, but there is no cure of the underlying infection, which stays dormant in the body and can reactivate. Zoster can lead to painful nerve inflammation that persists after the skin rash has healed. Early treatment can help reduce the likelihood of long term nerve pain. Antibiotic ointments can help keep the infection from becoming super-infected. The skin rash should be kept covered until healed to prevent spreading the infection to those in close contact.


This infection is caused by a fungus present in the soil contaminated with bat or bird droppings, particularly in eastern and central United States as well as in Mexico. It gets in the air when the soil is disturbed, such as when people explore caves. It is not passed from person to person.

Symptoms can include:

weight loss
shortness of breath
abdominal pain

Histoplasmosis can be quite serious but is treatable with antibiotics, which need to be continued until the immune system has improved with HIV treatment. Long-term suppression with antibiotics may be required if the disease relapses.

HIV dementia

Sometimes called "HIV encephalopathy" or "AIDS dementia," this disease is caused by HIV invading the brain. It is most common when the CD4 cell count has gotten very low.

Symptoms can include:

memory loss
depressed mood
unsteadiness when walking
shaky hands (poor handwriting)
personality changes

This condition is less common now that there are drugs available to treat HIV. It may even be prevented by using HIV drugs that cross into the blood.

People who are affected need to have a strong support system. Friends, roommates, or family members can help make sure that HIV medications are taken on time, in the right combination, and at the right dose. If memory is poor, a person can use notes, calendars, and alarms to remember medicines, appointments, and other important events.

HIV wasting syndrome

Wasting syndrome refers to unwanted weight loss that is equal to more than 10 percent of their body weight. For a 150-pound man, this means a loss of 15 pounds or more. Weight loss can result in loss of both fat and muscle. Once lost, the weight is difficult to regain.

The condition can be caused by many things: HIV, inflammation, or opportunistic infections. The weight loss may be accompanied by low-grade fever, and sometimes diarrhea. The person may get full easily, or have no appetite at all.

The most important treatment for wasting syndrome is effective treatment of HIV with antiretrovirals. In addition, the condition may be controlled, to some degree, by eating a good diet. A "good diet" for an HIV-positive person may not be the low-fat, low-calorie diet recommended for healthy people. Compared with other people, you may need to take in more calories and protein to keep from losing muscle mass. To do this, you can add to your meals:

peanut butter
legumes (dried beans and peas)
instant breakfast drinks

You can also maintain or increase muscle mass through exercise, especially with progressive strength-building exercises. These include resistance and weight-lifting exercise. (For more diet and exercise tips, see the Daily Living section.)


This condition is caused by a parasite found in feces. It may contaminate food or drinking water. It is most common in tropical and subtropical regions of the United States. To avoid infection, do not drink water from rivers and streams. When appropriate, drink bottled water or use filters on tap water. Cook food thoroughly.

Symptoms can include:

stomach cramps
watery diarrhea
weight loss (which may be significant)
loss of appetite

Rehydration and nutritional support are key components of treatment. Antiparasitic drugs can treat the infection, but they may need to be taken for a long time to keep the parasite in check. Immune reconstitution with HIV treatment may help prevent relapse.

Kaposi sarcoma

Kaposi sarcoma (KS) is the most common cancer associated with HIV. This cancer is caused by the human herpes virus 8 (HHV-8). The virus can be spread by deep kissing, unprotected sex, and sharing needles. It also can be spread from mother to child.

Symptoms include brown, purple, or pink lesions (or blotches) on the skin, usually on the arms and legs, neck or head, and sometimes in the mouth. KS can also affect the lungs and intestines and cause swelling in the legs. Sometimes there is tooth pain or tooth loss, weight loss, night sweats, or fever for longer than 2 weeks.

HIV drugs can slow the growth of lesions, even reverse the condition itself. Other treatments for KS are meant to relieve symptoms and improve the appearance of the lesions. It's important that people with KS keep lesions clean. They should call their provider if the lesions are spreading, if swelling gets worse, or if they develop a cough, shortness of breath, or problems in the gut.


Lymphomas associated with HIV include a large group of cancers that begin in the cells of the immune system. The cancers can spread to different parts of the body, such as the central nervous system, liver, bone marrow, and gastrointestinal tract. Symptoms depend on where the cancer resides.

Treatment varies depending on the specific cancer, but can include radiation and chemotherapy. HIV drugs, by boosting the immune system, can help the body fight the cancer, too.

Mycobacterium avium complex (MAC)

This condition is caused by bacteria present everywhere in the environment--in soil, food and animals. It is difficult to avoid exposure because MAC is in so many places. In general, avoid handling soil, and carefully handle and prepare food.

Symptoms of MAC can include:

night sweats
weight loss
loss of appetite
chronic diarrhea
abdominal pain

HIV drugs, by helping your immune system stay strong, can help your body fight the infection. Antibiotics given over a long period of time can control the infection, and be stopped once the disease is cured and the immune system is stong enough. Call your doctor if you have vision changes or abdominal discomfort while being treated for MAC.

Pneumocystis pneumonia (PCP)

An fungus found in many places in the environment causes this condition. Nearly two out of three children have been exposed to it by age 4. However, PCP rarely causes disease unless there are underlying problems with the immune system, like HIV. The fungus can affect many organs, the most common being the lung.

Symptoms can include:

shortness of breath
dry cough
night sweats or fatigue

The usual treatment is with antibiotics called sulfa drugs. Do not take dairy products 2 hours before or 1 hour after a dose of sulfa. (Dairy products can interfere with your body's ability to absorb the medicine.)

PCP can be treated with antibiotics and if severe, may require steroids as well. After completing treatment, if you experience shortness of breath (especially with exertion), fever, chills and sweats, or a new cough, see your doctor.

Pneumonia, recurrent

Bacterial pneumonia (often caused by Streptococcus pneumoniae or Haemophilus influenzae) can affect people whose immune systems are not weakened by HIV. Persons infected with HIV, however, are much more likely than people who are HIV negative to develop bacterial pneumonia. Fortunately, these pneumonias can be treated with available antibiotics. HIV-infected persons should receive a vaccine called the Pneumovax, to help prevent pneumonia caused by Streptococcus pneumoniae.

Progressive multifocal leukoencephalopathy (PML)

This disease is caused by a virus called the JC virus. Most people probably already are infected, but in HIV-positive people this virus can cause disease. The virus is possibly spread through sexual contact, or from mother to child.

Symptoms can include:

difficulty in speaking
difficulty in walking
weakness in arms or legs
personality changes
changes in vision
shaky hands

There is no specific treatment for PML, but some HIV drug combinations can reverse the symptoms and keep the JC virus under control. People with PML should have a good support system. Friends, roommates, or family members can help make sure that HIV medications are taken on time, in the right combination, and at the right dose. The disease is extremely serious and can lead to death.

Salmonella septicemia, recurrent

Salmonella is a bacteria often found in food such as undercooked poultry, eggs, and unpasteurized milk. It is also present in water, soil, kitchen surfaces, animal feces, and raw meat and on certain animals, such as reptiles. Because of the risk of salmonella, reptiles are not recommended as pets for HIV infected patients, especially if their immune suppression is advanced.

Symptoms can include:


Salmonella septicemia usually is treated with antibiotics. Drug therapy may be required for life to prevent relapses.


The parasite that causes toxoplasmosis is found in almost all animals. Cats and birds are major sources of infection. Indoor cats pose less risk, but cats that are free of toxoplasmosis can go outside can carry it back in. Avoid cat feces (use gloves to change litter). Avoid handling birds. Never eat undercooked meats, particularly pork or lamb.

Symptoms can include:

dull, constant headache
changes in vision

Treatment for toxoplasmosis is sometimes lifelong to prevent symptoms from recurring.

Treatment of HIV with immune reconstitution is important. Toxoplasmosis can be treated with antibiotics, which need to be continued until the immune system improves.

If you are being treated for toxoplasmosis, see your doctor promptly if you develop a rash or if your symptoms worsen. Help your memory by posting reminder notes. Keep keys, glasses, phone numbers, and other important items in the same place, so you can always find them. Keep a calendar of your appointments posted in a place you look at a lot, such as across from your favorite chair.

Tuberculosis (TB)

Mycobacterium tuberculosis disease is caused by a bacteria passed through the air when someone coughs, sneezes, or talks. It is spread easily in closed-in places, such as low-income housing, shelters, and jails.

Tuberculosis (TB) can occur early in the course of HIV infection, often when CD4 counts are slightly below normal. Symptoms can include fever, night sweats, weight loss, fatigue, loss of appetite, and coughing.

TB can be prevented and usually is curable. If left untreated, it can kill. It's important that you take your TB medication exactly as prescribed (missed doses can result in the TB germ developing resistance to the drug). Some TB medications can damage your liver, but your liver usually recovers if the medications are stopped. If your skin or eyes turn yellow, or if your urine darkens to the color of Coca-Cola while you are taking tuberculosis medications, see your doctor immediately. It could be a sign of liver damage.

Many people who are exposed to TB do not developed active tuberculosis but have a small amount of TB in the body. If your provider diagnoses you with exposure to TB but not active TB, they may recommend treatment to reduce the likelihood of developing active disease

CD4 counts and infections

The weaker your immune system, the more likely you are to get an opportunistic infection.

In general, here's how a CD4 count relates to your risk of OIs:

Above 500 CD4 cells
No unusual infections likely to appear.

200-500 CD4 cells
There is an increased risk for certain infections, such as shingles, thrush, skin infections, bacterial sinus and lung infections, and TB.

<200 CD4 cells
There is an increased risk for PCP (pneumonia), and you should begin treatment to prevent it.

<100 CD4 cells
If counts are below 100, preventive treatment should begin for MAC and toxoplasmosis (if not already on PCP prophylaxis that helps prevent toxoplasmosis, like Septra)

<50 CD4 cells
Increased risk for cytomegalovirus

AIDS-defining illnesses

Certain serious and life-threatening diseases that occur in HIV-positive people are called "AIDS-defining" illnesses. When a person gets one of these illnesses, he or she is diagnosed with the advanced stage of HIV infection known as AIDS.

The Centers for Disease Control and Prevention (CDC) has developed a list of these illnesses (see below). No single patient is likely to have all of these problems. Some of the conditions, in fact, are rare.

Candidiasis of the esophagus, bronchi, trachea, or lungs (but NOT the mouth, which is also known as thrush)
Cervical cancer, invasive
Coccidioidomycosis, disseminated or extrapulmonary
Cryptococcosis, extrapulmonary
Cryptosporidiosis, chronic intestinal (greater than one month's duration)
Cytomegalovirus disease (other than liver, spleen, or nodes)
Cytomegalovirus retinitis (with loss of vision)
Encephalopathy, HIV related
Herpes simplex: chronic ulcer(s) (more than 1 month in duration); or bronchitis, pneumonitis, or esophagitis
Histoplasmosis, disseminated or extrapulmonary
Isosporiasis, chronic intestinal (more than 1 month in duration)
Kaposi sarcoma
Lymphoma, Burkitt's (or equivalent term)
Lymphoma, immunoblastic (or equivalent term)
Lymphoma, primary, of brain
Mycobacterium avium complex or M kansasii, disseminated or extrapulmonary
Mycobacterium tuberculosis, any site (pulmonary or extrapulmonary)
Mycobacterium, other species or unidentified species, disseminated or extrapulmonary
Pneumocystis jiroveci pneumonia
Pneumonia, recurrent
Progressive multifocal leukoencephalopathy
Salmonella septicemia, recurrent
Toxoplasmosis of brain
Wasting syndrome due to HIV
Preventing OIs

Opportunistic infections can be caused by viruses, bacteria, and fungus, even parasites. One way to avoid these infections is to reduce your risk of exposure to these germs. The following pages offer some practical suggestions.

Sexual exposures
Use condoms every time you have sex.
Avoid oral-anal sex.
Use waterproof gloves if you're going to insert your finger into your partner's anus.
Frequently wash hands and genitals with warm soapy water after any sex play that brings them in contact with feces.
Injection drug use
Do not inject drugs.
If you cannot stop using, avoid sharing needles and other equipment.
Get vaccinated against hepatitis A and hepatitis B.
Job exposure

Certain type of jobs or facilities can put an HIV-positive person at risk of OIs. These include work in:

health care facilities
homeless shelters
day-care centers
places that involved work with animals (such as farms, veterinary clinics, pet stores)
Pet exposure

Pets can carry diseases that don't affect a healthy person but can pose a serious risk to someone with HIV. For that reason, if you have a pet, follow these suggestions.

Wash your hands after handling your pet (especially before eating).
Avoid contact with your pet's feces. If your pet has diarrhea, ask a friend or family member to take care of it.
If you are getting a new pet, try not to get one that is younger than a year old, especially if it has diarrhea. (Young animals are more likely to carry certain germs like Salmonella.) Avoid stray animals.
Keep your cat indoors. It should not be allowed to hunt, and should not be fed raw or undercooked meat.
Have a friend or family member clean the litter box daily. If you have to do it yourself, wash your hands thoroughly afterward.
Control fleas (ask your vet how to do this).
Avoid playing with your cat in ways that may result in scratches or bites. If you do get scratched or bitten, wash the area right away. Don't let your cat lick your cuts or wounds.
Avoid areas where there are bird droppings. Do not disturb soil underneath bird-roosting sites.
Avoid touching reptiles, such as snakes, lizards, iguanas, and turtles.
Wear gloves if you are cleaning an aquarium.
Cautions about food and water
Avoid raw or undercooked eggs (including hollandaise sauce, Caesar salad dressing, some mayonnaises, eggnog, cake and cookie batter).
Avoid raw or undercooked poultry, meat, and seafood (especially raw seafood). Use a meat thermometer. Cook poultry to 180° F, and other meats to 165° F. If you don't have a meat thermometer, cook meat until no traces of pink remain.
Avoid unpasteurized dairy products and fruit juice.
Avoid raw seed sprouts (such as alfalfa, mung beans).
Wash fruits and vegetables thoroughly before eating.
Don't let uncooked meats come into contact with other uncooked foods. (Wash thoroughly hands, cutting boards, counters, knives, and other utensils after contact with uncooked meats.)
Do not drink water directly from lakes or rivers. Filtered water is preferable, particular if your immune system is weak.

HIV-positive people whose immune systems are severely weakened may want to:

Avoid soft cheeses (feta, brie, camembert, blue-veined, and Mexican-style cheeses, such as queso fresco).
Cook leftover foods or ready-to-eat foods, such as hot dogs, until they are steaming hot.
Avoid food from delicatessens, such as prepared meats, salads, and cheeses--or heat these foods until steaming before eating.
Cautions about travel

Before you travel to other countries, particularly developing countries, talk to your doctor about ways you can avoid getting sick on your trip.

When traveling in developing countries, people who are HIV positive have to be especially cautious of food and water that may be contaminated. It is best to avoid:

raw fruits and vegetables (unless you peel them first)
raw or undercooked seafood or meat
tap water (or ice made with tap water)
unpasteurized milk or dairy products
swallowing water when swimming

Talk to your health care provider about whether you need to get vaccinated before your trip and whether you need to take drugs to prevent diseases that are common in the country you are going to visit.