The main causes of pneumonia
Pneumonia happens when germs — usually bacteria, viruses, or fungi — get into your lungs and cause an infection. Your lungs fill with fluid or pus, which makes it hard for oxygen to reach your bloodstream. Most pneumonia cases come from three types of germs: bacterial pneumonia (the most common and usually the most serious), viral pneumonia (often milder but can develop into bacterial pneumonia), and fungal pneumonia (rare, usually only in people with weakened immune systems).
You catch pneumonia the same way you catch a cold or flu — through the air when an infected person coughs or sneezes, or sometimes by touching a contaminated surface and then touching your face. Most people's immune systems fight off these germs before they reach the lungs, but if your defenses are weakened or the germ is particularly strong, infection takes hold.
Key Takeaways
- Bacterial, viral, and fungal infections are the three main causes of pneumonia, with bacteria causing the most severe cases.
- Pneumonia spreads through the air when infected people cough or sneeze, the same way colds and flu spread.
- Your risk increases if you smoke, have a chronic illness, are over 65, or have a weakened immune system.
- Aspiration pneumonia occurs when food, liquid, or stomach contents accidentally enter the lungs instead of the esophagus.
- Chemical pneumonia can develop from breathing in harmful fumes or gases, not from infection.
Bacterial pneumonia and who gets it
Streptococcus pneumoniae is the bacterium that causes pneumonia most often. Other common bacterial culprits include Haemophilus influenzae and Legionella pneumophila (which spreads through contaminated water systems). Bacterial pneumonia tends to come on suddenly and causes high fever, cough with colored mucus, and chest pain.
You are at higher risk for bacterial pneumonia if you smoke, have chronic lung disease like COPD or asthma, have heart disease, are over 65 years old, or have a weakened immune system from HIV, chemotherapy, or certain medications. People who have recently had the flu are also more vulnerable because the virus damages the lungs' protective lining.
Viral pneumonia and its patterns
Viruses that cause pneumonia include influenza (flu), respiratory syncytial virus (RSV), parainfluenza, and coronaviruses including SARS-CoV-2. Viral pneumonia often starts with cold or flu symptoms — sore throat, runny nose, muscle aches — and then the cough deepens and breathing becomes difficult. The illness usually develops more gradually than bacterial pneumonia.
Viral pneumonia is often milder than bacterial pneumonia, and many people recover without specific treatment as their immune system fights the virus. However, viral pneumonia can weaken your lungs enough that bacteria move in afterward, leading to secondary bacterial pneumonia that is more serious. This is why some people seem to get better from the flu and then suddenly get worse.
Fungal pneumonia and who is at risk
Fungal pneumonia is uncommon in otherwise healthy people. It occurs mainly in people with severely weakened immune systems — those with advanced HIV/AIDS, people taking immunosuppressant medications after organ transplant, or those undergoing chemotherapy. Common fungi that cause pneumonia include Pneumocystis jirovecii, Histoplasma, Coccidioides, and Cryptococcus.
Some fungal pneumonias come from breathing in fungal spores from soil or bird droppings in specific geographic regions. Others develop when a fungus already present in the body spreads to the lungs because the immune system cannot control it. Fungal pneumonia develops slowly and may not cause obvious symptoms at first, which is why it is sometimes discovered during screening of people with very low immune cell counts.
Aspiration pneumonia from food or liquid in the lungs
Aspiration pneumonia happens when food, liquid, stomach contents, or saliva accidentally enters the lungs instead of going down the esophagus to the stomach. This can occur if you have difficulty swallowing, are unconscious or sedated, or have a condition that affects the swallowing reflex. The material itself can damage lung tissue, and bacteria from the mouth or stomach can cause infection.
People at higher risk include those who have had a stroke, have Parkinson's disease or other neurological conditions, are elderly and frail, or have been sedated for surgery. Aspiration pneumonia often involves multiple types of bacteria and can be harder to treat than pneumonia from a single germ. If you notice coughing or choking during meals, or if someone you care for does, mention it to a doctor because it may signal a swallowing problem that needs attention.
Chemical pneumonia from inhaled fumes or gases
Chemical pneumonia is not caused by infection — it results from breathing in irritating or toxic fumes, gases, or particles. Common sources include chlorine gas, ammonia, sulfur dioxide, smoke from fires, or vapors from certain industrial chemicals. The harmful substance inflames the lungs' air sacs and airways, causing cough, shortness of breath, and chest tightness.
Chemical pneumonia can develop within hours of exposure or may take days to appear. Unlike infectious pneumonia, it does not spread from person to person and antibiotics do not help. Treatment focuses on removing the person from the source of exposure and supporting breathing while the lungs heal. If you work in an environment with chemical exposure, proper ventilation and protective equipment are essential.
Risk factors that make pneumonia more likely
Certain conditions and habits make you more vulnerable to pneumonia regardless of which germ causes it. Smoking damages the lungs' ability to clear mucus and fight infection, making smokers much more likely to develop pneumonia. Chronic diseases like COPD, asthma, heart disease, and diabetes all increase risk. Age matters too — pneumonia is more common and more serious in children under 5 and adults over 65.
A weakened immune system from HIV, cancer treatment, organ transplant, or medications that suppress immunity makes all types of pneumonia more likely. Recent hospitalization, especially if you were on a ventilator, raises risk because you may have been exposed to bacteria that are resistant to common antibiotics. Alcohol use disorder, malnutrition, and being bedridden or immobile also increase vulnerability because they weaken the body's defenses.
Frequently Asked Questions
Can you get pneumonia from being cold or wet?
No. Cold weather and wet conditions do not directly cause pneumonia. However, people spend more time indoors during cold months, which increases exposure to germs that cause pneumonia. Being cold or wet may stress your immune system slightly, but infection requires exposure to a specific germ.
Is pneumonia contagious?
Infectious pneumonia — bacterial, viral, and fungal types — spreads through the air or contact with respiratory droplets. You can catch it from an infected person. Chemical and aspiration pneumonia do not spread from person to person because they are not caused by germs.
Can pneumonia develop from untreated bronchitis?
Bronchitis and pneumonia are separate infections, but they can occur together or one after the other. Bronchitis inflames the airways; pneumonia infects the air sacs deeper in the lungs. If bronchitis is caused by a virus, that same virus can sometimes spread to the lungs and cause pneumonia.
Why do some people get pneumonia and others exposed to the same germ do not?
Your immune system's strength at the time of exposure matters greatly. Factors like sleep, stress, nutrition, age, and whether you have chronic illness all affect how well your body fights off germs. Even if two people breathe in the same bacteria, one person's immune system may clear it before infection takes hold while the other's does not.
Can you get pneumonia more than once?
Yes. Having pneumonia once does not make you immune to future cases. You can catch pneumonia from different germs at different times. Some people, especially those with chronic lung disease or weakened immunity, experience pneumonia repeatedly.