What Causes a Lung Infection? Bacteria, Viruses & More

Lung infections are caused by bacteria, viruses, or fungi that reach the lower airways and overwhelm the body’s defenses. In 2023, lower respiratory infections were responsible for 2.5 million deaths worldwide, with children under 5 and adults over 70 carrying the highest burden. Understanding what allows these infections to take hold helps explain why some people get them repeatedly while others rarely do.

How Pathogens Get Past Your Defenses

Your lungs have a layered defense system. The nose and throat filter out most particles, a layer of mucus traps what gets through, and tiny hair-like structures called cilia sweep that mucus back up toward the throat. Immune cells stationed in the air sacs of the lungs act as a last line, swallowing and destroying anything that makes it that far.

A lung infection starts when a pathogen slips past all of these barriers, or when those barriers are weakened. Once bacteria make contact with airway cells, the body launches an inflammatory response within hours. The cells lining the airways send chemical signals that pull immune cells from nearby blood vessels into the air sacs, a process that begins within three to four hours of exposure. That rush of immune activity is what produces the familiar symptoms of pneumonia: fever, cough, mucus, and difficulty breathing. The inflammation is your body fighting back, but it also damages delicate lung tissue in the process.

Bacterial Causes

Bacteria are the most lethal cause of lung infections globally. A single species, Streptococcus pneumoniae, accounts for roughly 634,000 lung infection deaths per year, about 25% of the global total. Staphylococcus aureus follows at around 271,000 deaths, and Klebsiella pneumoniae contributes another 228,000.

Some bacteria have evolved sophisticated ways to dodge your defenses. Mycoplasma pneumoniae, one of the most common causes of “walking pneumonia,” uses a specialized attachment structure to latch onto airway cells so tightly that the normal mucus-clearing system can’t sweep it away. It also produces a toxin that triggers inflammation and disrupts airway function. Perhaps most concerning, it can slip inside host cells, where it hides from the immune system and becomes harder for antibiotics to reach. This ability to go intracellular may explain why some mycoplasma infections become chronic.

Bacterial pneumonia tends to show up on imaging as a dense area of infection in a single lobe of the lung, sometimes with fluid buildup around the lung. But these patterns aren’t always reliable for pinpointing the exact cause, so doctors typically combine imaging with blood work and other tests.

Viral Causes

Viruses cause a large share of lung infections, especially in children and during winter months. The major culprits include influenza, respiratory syncytial virus (RSV), coronaviruses (including the virus that causes COVID-19), adenoviruses, parainfluenza viruses, and human metapneumovirus. Rhinoviruses, which are the usual cause of the common cold, can also move into the lungs and cause pneumonia in vulnerable people.

Viral lung infections often start as a typical upper respiratory illness, with a sore throat, runny nose, and body aches, before spreading deeper into the airways. One important complication is that a viral infection can damage the airway lining enough to let bacteria gain a foothold. This “secondary bacterial infection” is a well-known pattern with influenza and is often more dangerous than the initial viral illness.

Fungal Causes

Fungal lung infections are less common overall but can be serious, particularly for people with weakened immune systems. Aspergillus species alone account for roughly 67,800 lung infection deaths per year globally. Non-tuberculous mycobacteria, which behave similarly to fungi in how they’re acquired from the environment, cause an estimated 177,000 deaths annually.

Most fungal lung infections come from breathing in spores found in soil or animal droppings. Histoplasmosis comes from a fungus found in soil contaminated with bird or bat droppings, common in parts of the Ohio and Mississippi River valleys. Blastomycosis comes from a soil-dwelling fungus found in the Great Lakes region and other parts of the U.S. Valley fever (coccidioidomycosis) is caused by a fungus in the dry soils of the southwestern U.S. and parts of Mexico. For most healthy people, exposure to these fungi causes mild or no symptoms. Severe illness is more likely when someone inhales a large amount of spores or has a compromised immune system.

Aspiration: When Food or Fluid Enters the Lungs

Aspiration pneumonia happens when something other than air enters your lower airways. This can be food, liquid, saliva, stomach acid, or vomit. The material itself irritates the lung tissue, and bacteria from the mouth or stomach hitchhike in and multiply.

Certain conditions make aspiration far more likely. Difficulty swallowing (dysphagia) is one of the biggest risk factors, and it’s common after a stroke or brain injury, or in neurological conditions like Parkinson’s disease and multiple sclerosis. Other high-risk situations include recent general anesthesia, dental procedures, heavy alcohol or drug use, and chronic acid reflux (GERD), which can send stomach acid up toward the throat during sleep. Adults over 65 and residents of assisted living facilities face elevated risk.

Chemical and Environmental Triggers

Not every lung infection starts with a living organism. Chemical pneumonitis is inflammation caused by inhaling toxic substances. The symptoms, including cough, fever, and abnormal chest imaging, can look identical to an infectious pneumonia. Vaping and “dabbing” concentrated THC products have emerged as recognized causes. When THC extract made with butane is heated to high temperatures, it can break down into byproducts that are directly toxic to lung tissue. Doctors now screen for a condition called EVALI (e-cigarette or vaping product use-associated lung injury) when patients who vape develop unexplained lung inflammation.

Industrial chemicals, certain cleaning products, and inhaled gases can cause similar damage. The inflamed, injured lung tissue left behind by chemical exposure is also more vulnerable to secondary bacterial or fungal infection.

Who Gets Lung Infections More Easily

Some people face a much higher baseline risk. Chronic lung diseases like COPD and asthma leave the airways already inflamed and structurally damaged, making it easier for pathogens to gain entry. Heart disease, diabetes, and chronic kidney disease all weaken the body’s ability to mount an effective immune response. The CDC notes that these conditions can also worsen outcomes because the organs affected by the infection are already under strain.

Age plays a major role at both ends of the spectrum. Children under 5 have immune systems that are still maturing, though mortality in this group has dropped by about 33% since 2010 thanks to better vaccines and care. Adults over 70 are vulnerable because immune function naturally declines with age, cough reflexes weaken, and chronic conditions accumulate.

Immunosuppression from chemotherapy, organ transplants, or conditions like HIV dramatically expands the range of organisms that can cause infection. Fungi and bacteria that a healthy immune system would easily clear become capable of causing life-threatening pneumonia in these patients.

Hospital-Acquired vs. Community-Acquired Infections

Where you pick up a lung infection matters because it changes which organisms are likely responsible. Community-acquired pneumonia, the kind you develop in daily life, is most often caused by Streptococcus pneumoniae, Mycoplasma pneumoniae, and respiratory viruses. Hospital-acquired pneumonia involves a different and often more dangerous set of bacteria, including multidrug-resistant strains that are harder to treat. Being on a ventilator, having a weakened immune system, or spending extended time in an ICU all increase the risk of picking up these tougher organisms.

People who live in nursing homes or frequently visit healthcare facilities for treatments like dialysis face a similar risk profile to hospitalized patients. The bacteria circulating in healthcare environments are more likely to carry resistance to common antibiotics, which means infections acquired in these settings often require broader, more aggressive treatment.