Pneumonia can be caused by both viruses and bacteria. These are the two most common causes, though fungi and parasites can also infect the lungs less frequently. The type of germ responsible shapes how pneumonia feels, how doctors treat it, and how long recovery takes.
Common Bacterial Causes
Streptococcus pneumoniae (often just called pneumococcus) is the single most common bacterial cause of pneumonia acquired outside of hospitals. It tends to produce what doctors call lobar pneumonia, meaning the infection concentrates in one section or lobe of the lung, creating a dense area of inflammation visible on a chest X-ray. Pneumococcal pneumonia is serious: roughly 1 in 20 people who develop it die from the infection.
Mycoplasma pneumoniae is the other major bacterial culprit in the community. It causes a milder form sometimes called “walking pneumonia” because people often stay on their feet through it. Symptoms can take one to four weeks to appear after exposure and may linger for several weeks, but most people recover without prescription medication. There’s no quick office test for it the way there is for flu or COVID, so doctors typically diagnose it based on symptoms and a chest X-ray.
Bacterial pneumonia symptoms usually come on more abruptly: high fever, shaking chills, chest pain, rapid or labored breathing, and a productive cough. In older adults, confusion or unusual drowsiness may be the most noticeable sign rather than the classic fever and cough.
Common Viral Causes
A wide range of viruses can infect the lungs. The CDC lists COVID-19, influenza, RSV, human metapneumovirus, parainfluenza viruses, and rhinovirus among the most frequent viral causes of pneumonia. In children specifically, rhinovirus and RSV are the leading culprits. RSV infects nearly all children by age two, and reinfection throughout life is common. It poses the greatest danger to premature infants, young babies, older adults, and people with weakened immune systems or chronic lung conditions.
Viral pneumonia typically starts with upper respiratory symptoms (sore throat, runny nose, body aches) that gradually move deeper into the lungs over several days. On imaging, viral infections tend to look different from bacterial ones. Instead of a solid patch of consolidation in one lobe, viral pneumonia often shows a more diffuse, hazy pattern across both lungs, with thickened tissue between air sacs and what radiologists call “ground glass” opacities. Influenza, for example, can produce bilateral haziness that in severe cases resembles acute respiratory distress.
How Doctors Tell Them Apart
Distinguishing bacterial from viral pneumonia matters because the treatment is fundamentally different: antibiotics work against bacteria but do nothing for viruses. Doctors use a combination of clues to sort this out. The pattern on a chest X-ray helps. A dense consolidation in a single lobe suggests bacteria, while diffuse haziness across both lungs leans toward a viral cause.
Blood tests add another layer. A marker called procalcitonin rises sharply when bacteria are involved. In one study of children with pneumonia, those with a purely viral infection had a median procalcitonin level of 0.14, while those with a bacterial co-infection had a median of 1.41, roughly ten times higher. Patients with elevated procalcitonin had 17.5 times greater odds of having a bacterial infection on top of the viral one. This test is about 80% accurate at distinguishing the two and helps doctors avoid prescribing antibiotics when they aren’t needed.
Rapid tests for specific viruses (flu, COVID-19, RSV) can also confirm a viral cause quickly, though testing for some viruses and bacteria like Mycoplasma requires sending samples to a lab, which takes longer.
When Viruses Lead to Bacterial Infection
One of the most dangerous scenarios is when a viral infection opens the door to a secondary bacterial pneumonia. This happens because viruses damage the lining of the airways, strip away the protective mucus layer, and suppress the immune cells that normally keep bacteria in check. The virus essentially breaks down the lung’s defenses, allowing bacteria that normally live harmlessly in the nose and throat to invade deeper into the lungs.
This isn’t rare. During the 2009 H1N1 influenza pandemic, bacterial co-infection was found in about 30% of fatal cases. Estimates suggest bacterial pneumonia complicates anywhere from 0.5% to 6% of influenza infections overall, with much higher rates among people sick enough to be hospitalized. During earlier influenza pandemics in 1957 and 1968, secondary bacterial infections were involved in 50% to 70% of severe cases.
This is a key reason why viral pneumonia can turn suddenly worse after a few days of apparent improvement. If you start feeling better from a respiratory illness and then spike a new fever or develop worsening breathing difficulty, a secondary bacterial infection is one likely explanation.
Treatment Differences
Bacterial pneumonia is treated with antibiotics, and most people begin to improve within a few days of starting them. The specific antibiotic depends on which bacterium is suspected or confirmed.
Viral pneumonia treatment is more limited. For influenza, antiviral medications like oseltamivir (Tamiflu) can shorten the illness and reduce severity, especially when started within the first 48 hours of symptoms. COVID-19 has its own set of antivirals. For RSV, an inhaled antiviral called ribavirin is sometimes used in severe cases, particularly in people with compromised immune systems. For many other viral pneumonias, though, treatment is primarily supportive: rest, fluids, supplemental oxygen if needed, and fever management while the immune system clears the infection.
Most mild viral pneumonias resolve on their own within one to three weeks, though fatigue and a lingering cough can persist longer. Bacterial pneumonia, when treated with the right antibiotic, typically improves faster, but full recovery can still take several weeks, especially in older adults.
Vaccines That Prevent Pneumonia
Several vaccines target the most common and dangerous causes of pneumonia. For bacterial prevention, pneumococcal vaccines are recommended for all children under five (a four-dose series starting at two months) and for all adults 50 and older. Adults in this age group who have never received a pneumococcal conjugate vaccine need one dose of PCV15, PCV20, or PCV21. If PCV15 is used, a follow-up dose of a different pneumococcal vaccine is needed about a year later. PCV20 or PCV21 completes the series in a single shot.
On the viral side, annual flu vaccines reduce the risk of influenza pneumonia, and COVID-19 vaccines lower the chance of severe lung infection from SARS-CoV-2. RSV vaccines are now available for older adults and for pregnant people to protect newborns. Together, these vaccines cover several of the most lethal causes of pneumonia, making them one of the most effective prevention tools available.

