Let’s Talk About Pneumonia Causes

From tricky bacteria to viral infections, here’s the info you need on what leads to this challenging lung illness.

You probably have some idea of what pneumonia is, but here’s something you may be less sure about: What causes pneumonia in the first place? And what can you do to keep from getting it? While some risk factors for getting pneumonia can’t be changed, like your age or whether you have an underlying chronic condition, others can be managed or modified. And knowing the most common direct causes of pneumonia can help you avoid them. Read on for the knowledge that can help you ward off this lung infection—or skillfully navigate it if you do get it.

Pneumonia Causes

Our Pro Panel

We went to some of the nation’s top experts in lung disorders and infectious diseases to bring you the most scientific and up-to-date information available.

Michael Gutwein, M.D.

Michael Gutwein, M.D.

Chief Emeritus, Infectious Disease Division

Missouri Baptist Medical Center

St. Louis, MO

Jeffrey Pernica, M.D.

Jeffrey Pernica, M.D.

Head, Division of Infectious Diseases and Associate Professor, Department of Pediatrics

McMaster University

Hamilton, ON

Rachel Scheraga, M.D.

Rachel Scheraga, M.D.

Assistant Professor of Medicine and Associate Staff Physician, Pulmonology and Critical Care Medicine

Cleveland Clinic

Cleveland, OH

Pneumonia Causes
Frequently Asked Questions
Is pneumonia caused by bacteria more serious than pneumonia caused by a virus?

Yes, it’s usually more serious, especially if you take COVID pneumonia (caused by the SARS-CoV-2 virus) out of the equation. But either bacterial or viral pneumonia can become severe, especially in very young children and people over 65.

Will the doctor definitely know what’s causing my pneumonia?

Not necessarily. Even if you’re coughing up phlegm and the doctor gets a sample of it to send to a lab, the results of these tests are often inconclusive. Either way, your doc will likely start treatment before results are in. More specific testing for the infecting pathogen is recommended only in severe cases of pneumonia that require hospitalization, according to the latest treatment guidelines from the American Thoracic Society and Infectious Diseases Society of America.

What is aspiration pneumonia?

This type of pneumonia happens if you accidentally inhale a food particle, liquid, vomit, or regurgitated stomach acid and aren’t able to cough it out, which allows it to get into your lungs. Microorganisms within the substance can then cause an infection. Aspiration pneumonia mostly happens in people who have difficulty swallowing or coughing—for example, from a previous stroke.

Is pneumonia contagious?

Yes, if it’s caused by a virus or bacteria. You can spread or catch it just like other infectious illnesses like colds, flu, and now, COVID-19. Similarly, the measures you take to prevent those infections—such as washing your hands frequently, using hand sanitizer, staying away from people who are sick, and not touching your face—can also help keep you from getting pneumonia. If pneumonia is caused a fungus or by aspirating food particles or liquids, it’s not contagious.

Remind Me, What Is Pneumonia?

Pneumonia is an infection in one or both of your lungs caused by a microorganism, usually a virus or bacteria. Specifically, pneumonia affects your lungs’ alveoli, or air sacs. Here’s a quick overview: Each of your lungs has a main airway, called a bronchus (plural bronchi), that leads into it from your trachea, or windpipe. The two bronchi branch off into smaller bronchi, which in turn divide into thousands of even smaller airways called bronchioles. The bronchioles lead to millions of tiny air sacs (alveoli) that are covered in very small blood vessels called capillaries.

When your lungs are working normally, the capillaries get oxygen from the alveoli to deliver to the cells of the body and return carbon dioxide to them be exhaled. When you have pneumonia, however, the infected alveoli fill up with fluid or pus, rather than air. This limits that ability of oxygen to get into your bloodstream and to your body’s organs, and it triggers the various symptoms associated with pneumonia, like fever, cough, shortness of breath, and chest pain.

Pneumonia is a pretty common illness. Even before the coronavirus (COVID-19) pandemic, pneumonia affected millions of people in the U.S. each year, sent about 1.3 million to the emergency room, and killed around 50,000. COVID has driven those numbers much higher for the time being, since pneumonia is one of the possible complications of severe COVID. In data released in 2021, the National Center for Health Statistics estimated that more than 260,000 people in the U.S. died from pneumonia related to COVID between January 2020 and April 2021 alone. Pneumonia overall is most common in people older than 65, young children, and those with weakened immune systems.

The two main types of pneumonia are viral pneumonia and bacterial pneumonia. Less commonly, pneumonia can be caused by breathing in spores from a fungus (fungal pneumonia). More on those causes in a bit; first, let’s talk about what pneumonia looks and feels like.

Get the Full Story on Pneumonia

What Are the Symptoms of Pneumonia?

Pneumonia can affect different people very differently, with symptoms ranging from mild to severe. For reasons that aren’t entirely clear, older adults and people who have serious illnesses or weak immune systems may actually have fewer and milder symptoms of pneumonia than younger or healthier adults—even though pneumonia is more dangerous for them. For example, older adults with pneumonia sometimes have no fever or even lower-than-average body temperature. And rather than coughing, they may suddenly become confused or have other mental changes.

These are some of the most common pneumonia symptoms.

  • Chest pain (usually sharp or stabbing; may get worse when you breathe in or cough)

  • Chills

  • Cough (might be dry in viral pneumonia, especially early in the infection. In bacterial pneumonia, the cough is often “productive,” bringing up phlegm that’s green or yellow-tan in color or even bloody. As viral pneumonia worsens, it can progress to a productive cough.)

  • Faster-than-usual heartbeat and/or breathing (more common in children and younger adults)

  • Fatigue and weakness

  • Fever (over 100°F and sometimes as high as 105°F; high fever that comes on suddenly is more common in bacterial than viral pneumonia)

  • Mental confusion (more common in people over 65; sometimes this is the only warning sign of pneumonia in this age group)

  • Muscle pain or headache (more common in viral pneumonia)

  • Nausea and vomiting (more common in young children)

  • Shortness of breath

  • Sore throat (more common in viral pneumonia)

Emergency Pneumonia Symptoms

If you develop extreme difficulty breathing or have a blue tinge in your lips, fingernails, or other skin areas, it is an indication that your blood oxygen level is dangerously low. Do not wait to talk to a doctor in this situation: Call 911 immediately. Dehydration is another symptom that may lead to the need for hospitalization and intravenous fluids.

Pneumonia or COVID?

You probably noticed some of the symptoms above are similar to those of COVID or the flu (both of which can also cause pneumonia themselves). It can be really tricky to tell which you may have without testing, so if you’re having symptoms, it’s smart to consult your doctor who will likely administer a COVID and flu test to rule out alternatives.

Pneumonia Transmission

A pneumonia infection begins when you breathe in a bacterium or virus from the air—say, if a person with pneumonia coughs near you—or by touching something that an infected person touched or coughed on, then touching your nose or mouth without first washing or sanitizing your hands. In other cases, bacteria that normally live in your nose and throat without causing problems can take advantage of a weakened immune system (from a chronic illness, a recent bout of the flu, or an immune-suppressing medication, for example) to move into your lungs and multiply. Experts call this an “opportunistic infection.”

Another way you can develop pneumonia is if you accidentally inhale, or aspirate, food particles, saliva, or other liquids into your airways (bronchi). The particles may be contaminated with viruses, bacteria, or other microorganisms that then infect the lungs. This type of pneumonia is called aspiration pneumonia. It’s especially common in people who’ve had a stroke or who have other neurological conditions, like Parkinson’s disease.

Whatever the specific cause, once an infection takes hold in your lungs, your immune system goes into overdrive trying to stop the multiplying germs. This causes the air sacs and the tissue surrounding them to become inflamed and to fill up with fluid (pus), which in turn makes it harder for your body to get the oxygen it needs, impairing breathing and triggering the other symptoms of pneumonia.

What Causes Pneumonia?

The vast majority of pneumonia cases are caused by three types of tiny microorganisms, or germs: bacteria, viruses, and fungi. In order to get pneumonia, two things have to happen: One, the germ has to get into your body (or be there already); and two, the germ must make it past your body’s usual defenses to get into your lower respiratory tract, a.k.a. your lungs, where it then sets up camp and multiplies.

Given the two-barrier system in place to thwart these germs, pneumonia tends to develop in groups whose immune systems aren’t firing at full strength—namely infants and young children (whose immune systems aren’t fully developed yet), adults over 65 (whose immune systems are weakened by age), and people with weakened immunity due to a medical condition or immunosuppressive medication.

How Viruses Cause Pneumonia

Approximately half of all pneumonia cases are believed to be caused by viruses. Viral pneumonia tends to come on more slowly than bacterial pneumonia, with initial symptoms that may seem like a cold or the flu. Most people recover from viral pneumonia within a week or two, though some symptoms, like cough or tiredness, can hang around for longer than that. These are some of the most common viruses that cause pneumonia:

  • Influenza. Yep, that influenza—the same one that causes the upper respiratory illness known as the flu. When the influenza virus gets into the lungs (which can happen as a complication of flu, especially in older adults and people with impaired immunity), it’s called influenza pneumonia.

  • Rhinoviruses. Along with coronaviruses (see below), this group of viruses is best known for causing the common cold. Influenza and rhinovirus are the two most common causes of viral pneumonia in adults, according to the National Heart, Lung, and Blood Institute (NHLBI).

  • Respiratory syncytial virus (RSV). This virus is more common in babies and young children than in adults. It’s the most frequent viral cause of pneumonia in young children, according to the NHLBI.

  • Coronaviruses. These include several viruses that cause the common cold as well as SARS-CoV-2, the newly discovered coronavirus that causes COVID-19. If you develop pneumonia from SARS-CoV-2, it’s called COVID-19 pneumonia.

  • Measles virus. This extremely contagious virus (nine out of 10 people who come into contact with it will contract it, according to the CDC) can lead to potentially deadly pneumonia. In fact, pneumonia is the main reason for death in young children with measles.

  • Parainfluenza. This flu-like virus (hence the name) usually affects babies and young children.

  • Adenoviruses. These are common viruses that cause a range of illness, including bronchitis, colds, diarrhea, pink eye (conjunctivitis), and sore throat, in addition to pneumonia. You can get an adenovirus infection at any age. They’re a less common cause of pneumonia than the other viruses in this list.

You’ll notice that several of these viruses have vaccines available to prevent them—all the more reason to get your annual flu shot and make sure you are vaccinated against measles and COVID-19.

How Bacteria Causes Pneumonia

You can get bacterial pneumonia by itself, or it can come on the heels of a respiratory virus, like a cold or the flu, that make your lungs susceptible to a “secondary” bacterial infection. There are two reasons why having a virus heightens your risk for bacterial pneumonia: One, your immune system is already embattled from fighting the virus, making it less able to defend against bacteria; and two, viruses can cause acute (short-term) damage to your airways (bronchi) that leaves them more vulnerable to a bacterial invasion.

Unlike viral pneumonia, which tends to develop gradually, pneumonia caused by bacteria usually comes on fast and strong. Another difference: Bacterial pneumonia is often more serious and can affect just one portion (lobe) of a single lung. Left untreated, bacterial pneumonia can lead to scarring of your lung tissue, or the infection can spread to other vital organs. The earlier you get diagnosed and start treatment, the less damage will be done. Recovery from bacterial pneumonia may take up to three weeks.

Common types of bacterial pneumonia include:

  • Streptococcus pneumoniae (a.k.a. pneumococcus). This germ is the most common cause of bacterial pneumonia. An estimated 900,000 people in the U.S. get pneumococcal pneumonia each year; 400,000 are hospitalized for it and about 5% to 7% die from it, according to government data.

    The good news about pneumococcal pneumonia is that there’s a vaccine to prevent it, called the pneumococcal vaccine. It’s recommended for adults 65 and older, kids under 2, and people who smoke or have certain chronic health conditions. There are two types of pneumococcal vaccine: Prevnar 13 (PCV13) and Pneumovax 23 (PPSV23). Talk with your doctor about which you should have (some people should get both).

  • Haemophilus influenzae. This bacterium is a common cause of ear infections in children and bronchitis in adults. In addition to pneumonia, H. influenzae can cause serious and potentially life-threatening infections in the brain and spinal cord (meningitis) and the bloodstream (sepsis). Despite its name, it does not have anything to do with influenza (the flu).

  • Staphylococcus aureus (a.k.a. “staph”). These bacteria are a less common but potentially very dangerous cause of pneumonia. In a large study of 2,488 adults hospitalized for pneumonia, S. aureus bacteria was five times more common among patients who were severely ill and in the intensive care unit (ICU).

    A big concern with staph is that some strains have developed resistance to common antibiotics; this type of staph is known as methicillin-resistant Staphylococcus aureus, or MRSA. MRSA infections are especially prevalent in nursing homes and long-term care facilities, and pneumonia from these germs can be particularly severe and hard to treat.

  • Legionella pneumophila. This germ causes a severe type of pneumonia called Legionnaires' disease. Unlike other bacterial pneumonias, Legionnaires’ disease doesn’t spread from person to person. Instead, you get it from breathing in mist from water contaminated with the bacteria, according to the NIH. Outbreaks of Legionnaire’s disease have been linked to exposure from hot tubs, showers, and large building water systems.

  • Mycoplasma pneumoniae. This bacterium is widespread in the environment and usually infects people under age 40, especially if they live or work in crowded conditions. Pneumonia caused by M. pneumoniae is often mild enough to go undetected; you may have heard it referred to as “walking pneumonia” (so called because it doesn’t make you sick enough to have to stay home from work or school, hence you’re out walking around in the community).

  • Chlamydia pneumoniae. Like M. pneumoniae, these bacteria are especially likely to spread between people who live or work in crowded conditions, like schools, college residence halls, military barracks, nursing homes, hospitals, and prisons. Infection from C. pneumoniae has a longer incubation period than infection from many other bacteria and viruses—about three to four weeks from the time the person breathes in the bacteria to when they develop symptoms, according to the CDC.

What Causes Fungal Pneumonia?

This type of pneumonia is rare (it was detected in only 1% of samples in a national pneumonia study) and is mostly a risk if you have a weakened immune system—for example, you are undergoing chemotherapy for cancer, have had an organ transplant, or are living with untreated HIV infection—and/or you live in an area of the U.S. where certain fungi are endemic (exist naturally in the environment).

Fungal pneumonia is not contagious. It is caused by spores from fungi that become airborne (from the wind, say) and are breathed in. Fungal pneumonia can take longer to develop than bacterial and viral pneumonia. In fact, some types can have an incubation period of months after the spore is originally breathed in.

These are some of the fungi that cause pneumonia:

  • Coccidioides. This fungus lives in the soil in dry areas of the U.S., mainly in the Southwest. It causes an illness known as “Valley fever” (coccidioidomycosis) that sometimes develops into pneumonia. In 2018, there were 15,611 cases of Valley fever reported to the CDC, most of them in California and Arizona.

    Aside from usual pneumonia symptoms like cough, fatigue, fever, and shortness of breath, Valley fever can also cause night sweats and a rash on the upper body or legs. It’s most common in people older than 60. A small percentage of people who get Valley fever develop long-term lung infections that can take several years to get better, according to the CDC.

  • Cryptococcus. This fungus mainly infects people with suppressed immunity. Cryptococcus lives in the environment on trees, in tree hollows, and in the soil around trees, according to the CDC. It’s found in the Pacific Northwest and may grow in the Southeastern U.S. as well.

  • Histoplasma. This fungus is common in the eastern and central U.S., where it’s found in soil that contains a lot of bat or bird droppings. As with Valley fever, some people with histoplasmosis develop long-term lung infections.

  • Pneumocystis jiroveci. This tiny fungus lives in the lungs of many of us, causing no problems. But in people with weakened immunity (especially people with untreated HIV/AIDS) it can lead to infections, most commonly pneumonia. Catching it early is critical to surviving it. Some people at high risk for pneumocystis pneumonia may need to take antibiotics to prevent it.

Risk Factors for Pneumonia

In addition to the specific causes of pneumonia, we know that there are certain factors that increase your chances of getting it. Among them:


The risk of getting pneumonia is higher for children 2 and younger and adults 65 and older because these age groups have weaker immune systems.


The risk is highest if you’re in the ICU, especially if you are on a ventilator or sedated. Both make it difficult to cough, which is how your body clears germs out of the respiratory tract.

Underlying Medical Conditions

Sickle-cell anemia, cancer, cochlear implants, diabetes, heart disease, and kidney or liver disease all increase your risk.

Chronic Lung Condition

Asthma, chronic obstructive pulmonary disease (COPD), or cystic fibrosis are known risk factors.

Difficulty Swallowing

Trouble coughing or swallowing is a risk factor for aspiration pneumonia, which is caused by accidentally inhaling food particles or liquid into your airways (bronchi).

Environmental Factors

Certain pollutants, chemicals, or toxic fumes (for example, on the job) can up your odds of pneumonia.


Drinking alcohol heavily over time weakens the immune system, which increases your vulnerability to many infections, including pneumonia.

Long-Term Care Facility

Living in a nursing home or other long-term care facility raises your risk. Germs spread quickly in these environments, including drug-resistant ones like MRSA.

Recent Surgery

Major surgery or injury can make it difficult to cough (see above), and recovery often requires that you lie on your back for an extended period of time, allowing fluid or mucus to pool in your lungs. This provides a fertile breeding ground for bacteria.

Recent Illness

Not surprisingly, being sick with a cold or the flu (or COVID-19) ups your odds of pneumonia. These viral illnesses can either spread to the lungs themselves or make you susceptible to a secondary bacterial infection in your lungs (or in some cases, both).


It causes damage to your lungs that makes them more susceptible to attack by bacteria or viruses.

Weakened Immune System

People in this group include those who have HIV/AIDS or are undergoing chemotherapy, as well as people taking immunosuppressive medications due to an autoimmune condition (such as rheumatoid arthritis or multiple sclerosis) or an organ transplant.

Even if none of these bullets applies to you, that doesn’t mean you’re safe from pneumonia. It just means your chances of it are slimmer—and if you do get it, you’ll likely have an easier time kicking it.

How Is Pneumonia Treated?

Most people can recover from pneumonia on their own at home with a combination of oral medication, rest, and self-care measures. If you are having some difficulty breathing, you might also be prescribed a “breathing treatment,” in which you inhale aerosolized meds through a device called a nebulizer.

Pneumonia Medication

What drugs will your doctor prescribe? It depends on what’s believed to be causing your pneumonia. If the doctor thinks it’s bacterial, you’ll be prescribed one or more antibiotics. Antibiotics are used for some kinds of fungal pneumonia as well; other kinds are treated with antifungal drugs. Some common antibiotics used for pneumonia are amoxicillin, doxycycline, azithromycin, and clarithromycin.

If your doctor determines that the influenza (flu) virus is responsible for your pneumonia, he or she might prescribe an antiviral drug like Tamiflu (oseltamivir). These drugs don’t kill the virus, but if you start taking them within a few days of symptoms they can help stop the infection from proceeding, which might shorten your illness or reduce its severity.

If you’re diagnosed with COVID-19 pneumonia, talk with your doctor about which treatments make sense for you. Pneumonia from COVID can be more severe than pneumonia caused by other viruses, like rhinovirus and influenza (though those can cause severe pneumonia too, especially in older people).

While you’re recovering, follow these self-care steps, which can help speed your recovery, make you more comfortable while you get better, or both:

  • Get plenty of rest (like more than you normally do; this might not be hard because you may be too wiped out to do much anyway). See if someone else can help with meals, dishes, and so forth until you’re better.

  • Stay hydrated with plenty of water and other fluids. Children might also need an electrolyte-replenishing drink like Pedialyte; ask your pediatrician. Avoid alcohol; it can weaken your already embattled immune system.

  • Don’t smoke—it’s literally the worst thing you could do for your lungs right now.

  • Take over-the-counter (OTC) pain relievers such as Tylenol (acetaminophen) and Advil or Motrin (ibuprofen) as needed to reduce fever or quell aches and pains.

  • To ease a sore throat or cough, suck on lozenges or drink hot water with lemon and honey. Avoid taking OTC cough medication unless you check with your doctor first, since some of these can actually make your cough less productive (make it harder to cough up and expel phlegm).

  • Breathe in moist air to loosen lung secretions. This makes them easier to cough up and spit out. A cool mist humidifier or steamed-up shower works well for this.

With treatments in place, you can likely expect to be feeling better in one to three weeks, although your cough may linger for six weeks or longer…and you may still feel tired for a while.

While most people recover fully from pneumonia, it’s good to note that it’s not a one-and-done illness; you can get it again, which is why understanding what causes it is so important—so you can take steps to prevent it. As with other contagious illnesses, taking good care of your overall health and avoiding exposure to germs (hello, handwashing) can go a long way toward keeping you pneumonia-free. So can being up to date with your vaccines (and making sure your children get all their recommended vaccines on schedule). If you do get pneumonia, work closely with your doctor so you can get better as quickly as possible, and remember: We’re here to help you through this.

Jamie Kopf
Meet Our Writer
Jamie Kopf

Jamie Kopf is a health journalist with 20 years of experience writing and editing for consumer magazines, websites, and newsletters. Most recently she served as the editor of BerkeleyWellness.com and as senior editor of the University of California, Berkeley Wellness Letter, produced in partnership with the UC Berkeley School of Public Health.