Bacteria, viruses, and fungi cause most pneumonia cases

The three major causes of pneumonia are bacterial infection, viral infection, and fungal infection. Each type behaves differently in the lungs, spreads in different ways, and responds to different treatments. Knowing which type you have matters because antibiotics work against bacteria but not viruses, and fungal pneumonia requires its own class of drugs. A doctor can often narrow down the cause by listening to your lungs, looking at a chest X-ray, or running a sputum test—a sample of mucus you cough up.

The cause also affects how sick you become and how long recovery takes. Bacterial pneumonia tends to come on suddenly and can be severe. Viral pneumonia often develops more gradually and may feel like a lingering cold that worsens. Fungal pneumonia is less common but can be serious, especially in people with weakened immune systems. Understanding which type you're dealing with helps you know what to expect and what treatment options exist.

Key Takeaways

  • Bacterial pneumonia, caused by organisms like Streptococcus pneumoniae, typically develops suddenly and responds to antibiotics.
  • Viral pneumonia, often from influenza or respiratory syncytial virus (RSV), spreads through respiratory droplets and has no antibiotic treatment.
  • Fungal pneumonia occurs when mold spores are inhaled and is most common in people with compromised immune systems or those in certain geographic regions.
  • A chest X-ray, sputum culture, or blood test can help identify which type of pneumonia you have, guiding treatment decisions.
  • Some people develop pneumonia from more than one cause at the same time, a condition called superinfection.

Bacterial pneumonia: sudden onset and antibiotic response

Bacterial pneumonia is caused by bacteria invading the air sacs in your lungs. The most common culprit is Streptococcus pneumoniae, but other bacteria like Haemophilus influenzae, Legionella pneumophila, and Staphylococcus aureus can also cause it. Bacterial pneumonia typically strikes suddenly—you may feel fine one day and very ill the next, with high fever, shaking chills, and a cough that produces thick, discolored mucus.

Your immune system recognizes the bacteria as a threat and triggers inflammation in the lungs. This inflammation fills the air sacs with fluid or pus, making it harder for oxygen to reach your bloodstream. That's why bacterial pneumonia can cause shortness of breath and chest pain. A chest X-ray often shows a distinct pattern called consolidation—an area where the lung tissue appears solid rather than air-filled.

Bacterial pneumonia responds to antibiotics, which kill the bacteria or stop them from reproducing. The specific antibiotic depends on which bacterium is causing the infection. A sputum culture—where you cough into a cup and the sample is grown in a lab—can identify the exact bacterium, but doctors often start antibiotics before results come back based on what's most common in your area. Without treatment, bacterial pneumonia can become severe and lead to sepsis, a life-threatening condition where infection spreads through the bloodstream.

Viral pneumonia: gradual progression and supportive care

Viral pneumonia develops when a virus infects the lungs. The most common causes are influenza (flu), respiratory syncytial virus (RSV), and coronavirus (including SARS-CoV-2, which causes COVID-19). Viral pneumonia often starts as an upper respiratory infection—a cough, sore throat, or runny nose—that worsens over several days as the virus spreads deeper into the lungs.

Unlike bacterial pneumonia, viral pneumonia typically causes a dry cough at first, though it may become productive later. Fever is usually present but often lower than with bacterial pneumonia. The illness tends to develop more gradually, and you may feel tired and achy for days before breathing becomes difficult. Viruses spread through respiratory droplets when an infected person coughs or sneezes, which is why viral pneumonia spreads more easily in crowded settings.

There is no antibiotic that kills viruses, so treatment focuses on supporting your body while it fights the infection. This means rest, fluids, fever management, and oxygen if your blood oxygen drops too low. Some antivirals—medications that slow viral reproduction—exist for specific viruses like influenza and COVID-19, but only if started early. Most people recover on their own within one to three weeks, though fatigue can linger. The risk with viral pneumonia is that bacteria can move in afterward, a secondary infection called superinfection, which then requires antibiotics.

Fungal pneumonia: environmental exposure and immune status

Fungal pneumonia occurs when you inhale spores from mold or fungi in the environment. Unlike bacterial and viral pneumonia, which spread from person to person, fungal pneumonia comes from the air around you. The most common causes are Histoplasma capsulatum (found in soil, especially near bird and bat droppings), Coccidioides immitis (found in soil in the southwestern United States), and Cryptococcus (found in bird droppings and soil worldwide).

Fungal pneumonia develops slowly, often over weeks or months. You may have a persistent cough, low-grade fever, and fatigue that you might mistake for a lingering cold or bronchitis. Fungal pneumonia is uncommon in people with healthy immune systems—most cases occur in people with HIV/AIDS, those taking immunosuppressant medications, or people who have undergone organ transplants. However, some fungi like Coccidioides can cause pneumonia in otherwise healthy people who live in or travel to endemic areas.

Diagnosis requires specific tests because fungal pneumonia doesn't show up on a standard sputum culture. Doctors may order a fungal culture, a blood test for fungal antibodies, or a bronchoscopy—a procedure where a thin tube is passed down the airway to collect samples directly from the lungs. Treatment uses antifungal medications, which work differently from antibiotics and often require longer courses of therapy. Some fungal pneumonias can be serious if left untreated, particularly in immunocompromised individuals.

How doctors determine which type you have

Your doctor starts by asking about your symptoms, how quickly they developed, and whether you've been exposed to sick people or traveled recently. A physical exam—listening to your lungs with a stethoscope—can provide clues. Bacterial pneumonia often produces crackling sounds; viral pneumonia may sound different or nearly normal early on.

A chest X-ray is usually the next step. Bacterial pneumonia often shows a dense, localized area of consolidation. Viral pneumonia may show a more diffuse, patchy pattern throughout both lungs. Fungal pneumonia can look variable depending on the organism. Blood tests and a sputum culture help narrow things down further. If you're coughing up mucus, the lab can grow bacteria or fungi from it and identify which specific organism is present. Blood tests can show signs of bacterial infection (elevated white blood cells) or, in some cases, antibodies to specific viruses or fungi.

Sometimes the cause remains unclear even after testing, especially early in illness. Doctors may start treatment based on what's most likely while waiting for culture results to come back—a process that can take days or weeks. This is why initial treatment is sometimes adjusted once more information is available.

Risk factors that increase your chances of each type

Certain conditions and behaviors make pneumonia more likely overall, but some increase your risk for specific types. Smoking, chronic lung disease, and a weakened immune system raise your risk for all three. However, bacterial pneumonia is more common after a recent cold or flu, in people over 65, and in those with chronic heart or lung disease. Viral pneumonia is more likely if you're around people with active respiratory infections or during flu season.

Fungal pneumonia risk depends heavily on geography and immune status. If you live in the southwestern United States, you have higher exposure to Coccidioides. If you have HIV with a low CD4 count, you're at risk for Cryptococcus and Histoplasma. People who work with soil, compost, or bird droppings—gardeners, farmers, construction workers—have higher exposure to fungal spores. Vaccines can prevent some bacterial pneumonias (pneumococcal vaccine) and some viral pneumonias (flu and COVID-19 vaccines), which is why these are recommended for older adults and people with chronic conditions.

When pneumonia involves more than one cause

Sometimes a person develops pneumonia from multiple causes at once or in sequence. You might start with viral pneumonia and then develop a secondary bacterial infection—superinfection—as your immune system is already fighting the virus. This is why someone who seemed to be recovering from the flu suddenly gets worse. Another scenario is aspiration pneumonia, where food or liquid accidentally enters the lungs instead of the stomach, introducing bacteria from the mouth and throat.

Superinfection is one reason doctors sometimes prescribe antibiotics for viral pneumonia even though antibiotics don't kill viruses. If there's concern that bacteria have moved in, antibiotics may prevent or treat that secondary infection. However, unnecessary antibiotics also carry risks—they can cause side effects and contribute to antibiotic resistance—so doctors balance this carefully based on how sick you are and what your tests show.

Frequently Asked Questions

Can you have pneumonia from all three causes at the same time?

It's rare but possible. More commonly, a viral infection weakens your lungs and immune response, allowing bacteria to move in afterward. This sequence is more typical than simultaneous infection from all three types. Your doctor can test for multiple causes if your symptoms don't match a single type or if you're not improving as expected.

Does the type of pneumonia affect how long it takes to recover?

Yes. Bacterial pneumonia treated with antibiotics often improves within a few days, though full recovery takes weeks. Viral pneumonia typically takes one to three weeks without specific antiviral treatment. Fungal pneumonia often requires months of antifungal therapy and can take longer to resolve, especially in people with weakened immune systems.

If I had pneumonia once, am I more likely to get it again?

Not necessarily, but certain conditions increase recurrence risk. If you smoke, have chronic lung disease, or have a weakened immune system, you're at higher risk for another episode. Vaccines for pneumococcal bacteria and influenza virus can reduce your chances of those specific types. Quitting smoking and managing underlying health conditions also lower your risk.

How do I know if my pneumonia is getting worse instead of better?

Worsening pneumonia brings increased shortness of breath, confusion, chest pain that worsens with breathing, or a fever that returns after improving. If you're on antibiotics and feel worse after two to three days, contact your doctor—you may need a different antibiotic or additional testing. Seek immediate care if you have severe difficulty breathing or chest pain.

Can fungal pneumonia spread from person to person like bacterial or viral pneumonia?

No. Fungal pneumonia comes from inhaling spores in the environment, not from contact with an infected person. You cannot catch fungal pneumonia from someone else who has it. This is one key difference that affects how it spreads and who needs to take precautions around an infected person.