Once infected, the air sacs in the lungs become inflamed and fill up with fluid and pus, which causes coughing, fever, chills, and breathing problems. Symptoms may also include chest pain, dizziness, altered mental state, sweating, and rapid heartbeat, according to the Centers for Disease Control and Prevention (CDC). You can encounter the germs that cause pneumonia in the most common of places, and your daily environment may contribute to how susceptible you are to the disease. For example, children in school or day care facilities can easily catch viruses from one another, which makes them more prone to viral pneumonia. In general, viral pneumonia is more likely to spread from person to person than pneumonia caused by a bacteria or fungus. Some types of pneumonia spread only in certain environments. Legionnaires’ disease, which is caused by the bacteria Legionella pneumophila, may pose a threat only to people exposed to a contaminated air-conditioning system. It has also been linked to droplets inhaled at whirlpools, spas, or fountains. If you catch germs that cause pneumonia, your chance of developing the disease depends on your age, health, and lifestyle.

How Does Pneumonia Spread?

Pneumonia can be transmitted a number of ways. Coughing, sneezing, touching, and even breathing, notes the American Lung Association, can spread pneumonia from person to person. And it can be spread by people who don’t exhibit any symptoms. Bacterial pneumonia may follow a viral infection, such as a cold or the flu (influenza). This type of pneumonia may affect just one area of the lung and is referred to as lobar pneumonia, notes the Mayo Clinic. Types of bacteria that cause pneumonia include:

Streptococcus pneumoniaeLegionella pneumophila, the cause of Legionnaires’ disease, or LegionellosisMycoplasma pneumoniaeChlamydophila pneumoniaeHaemophilus influenzae type B (Hib)

Streptococcus pneumoniae, also known as pneumococcus, is the most common cause of bacterial pneumonia in adults, called pneumococcal pneumonia, according to the American Lung Association. It may be prevented by a vaccine. The CDC recommends two kinds of pneumonia vaccines: pneumococcal conjugate vaccines (PCV13, PCV15, and PCV20), and pneumococcal polysaccharide vaccine (PPSV23). The CDC recommends that all children under 2 and adults 65 or older get vaccinated, and clarifies that:

All babies and children under 2 should receive a dose of PCV13 (Prevnar 13), as should children 18 and under with certain medical conditions.Adults 65 and over and younger adults with certain medical conditions, who have never received any pneumococcal conjugate vaccine, should receive PCV15 (Vaxneuvance) or PCV20 (Prevnar 20). If PCV15 is used, it should be followed by a dose of PPSV23.PPSV23 (Pneumovax23) is recommended for children 2 through 18 years old with certain medical conditions and adults 19 years or older who receive PCV15.Children younger than 2 should not get PPSV23.Anyone younger than 19 should not get PCV15 or PCV20.

Mycoplasma pneumoniae usually infects younger adults who work in crowded areas, such as schools, homeless shelters, or prisons, according to the CDC. Chlamydophila pneumoniae causes a mild pneumonia infection that usually affects people older than 60, per the CDC. Haemophilus influenzae type B (Hib) infection can be prevented with a vaccine, called the Hib vaccine. It’s recommended for all children younger than 5 and is usually given to infants starting at 2 months old, notes the CDC. Most bacteria that cause pneumonia are pyogenic bacteria, which means they form pus, a combination of debris from serum, dead bacteria, and white blood cells. A cough that produces discolored mucus in the presence of fever and shortness of breath can be a classic sign of bacterial pneumonia. Other bacterial pneumonia symptoms include:

High feverChillsRapid breathingPain when coughing or breathing deeplyShortness of breathExhaustionLoss of appetite

Bacterial pneumonias tend to be more serious, with more noticeable symptoms than other types of pneumonia. You’re at greater risk for hospital-acquired pneumonia if you are older, have had chest surgery or other major surgery, have chronic lung disease, are immunocompromised, have alcohol use disorder, have swallowing problems and breathe saliva or food into your lungs (this can happen after a stroke), are on a ventilator, or are not mentally alert because of medication or illness. The first sign of hospital-acquired pneumonia may be mental confusion in older adults. Other symptoms include: fever or chills, a cough with greenish phlegm, loss of appetite, nausea and vomiting, chest pain, shortness of breath, and decreased blood pressure.

Persistent dry cough that often gets worse at nightLow-grade feverShortness of breathFatigue or tirednessChest pain that gets worse when you take a deep breath or coughLoss of appetite

Some less-common symptoms of walking pneumonia may also include:

DiarrheaRashSore throat

Viral pneumonias tend to clear up in about one to three weeks, but they can increase your risk of bacterial pneumonia. Viral pneumonia is usually less serious than bacterial pneumonia. At first, the symptoms of viral pneumonia may be similar to symptoms often associated with the flu, except you may experience a dry cough that does not produce phlegm. You may also develop a fever and headache. But within a couple of days, these symptoms typically get worse. Adults with viral pneumonia can also expect to develop:

Sore throatLoss of appetiteMuscle pain

The flu virus is a common cause of viral pneumonia in adults, which tends to be more serious in people with heart or lung disease, senior citizens, and pregnant women. Not only can influenza cause pneumonia, it can also predispose people to bacterial pneumonia — yet another good reason to get the yearly flu shot. Respiratory syncytial virus (RSV) pneumonia, another type of viral pneumonia, is usually a mild infection that clears up in about a week or two. It can be more severe and is more common in young children and older adults. In fact, RSV is the most common cause of pneumonia in children younger than 12 months, per the CDC. In the last few years, SARS-CoV-2, the virus that causes COVID-19, has caused viral pneumonia. COVID pneumonia often affects both lungs, and it tends to spread across the lungs slowly, lasting longer and causing more damage than other types of pneumonia, according to the Cleveland Clinic. If you have COVID pneumonia, you’ll likely be admitted to the hospital, and treatment may include certain antiviral medications, such as remdesivir, which targets the SARS-CoV-2 virus. Another antiviral is Paxlovid, though this is an outpatient medication, meant to be prescribed to patients not admitted to the hospital.

Coccidioides immitis and Coccidioides posadasii are two related fungi common to the American Southwest. Both can cause coccidioidomycosis, also known as cocci or valley fever, notes a review in the journal Virulence.Histoplasma capsulatum is found in the central and eastern United States, especially areas around the Ohio and Mississippi River valleys, and causes a disease called histoplasmosis.Cryptococcus is a fungi found in soil and bird droppings all across the country.Blastomyces, which can cause blastomycosis, is found largely in the Midwest and south-central and southeastern United States.

Most people who inhale these fungi don’t get sick, but if your immune system is weak, you may develop pneumonia. Another fungus, Pneumocystis jirovecii, can generate an infection in premature, malnourished infants, and in people with a weakened immune system, such as those who have HIV or AIDS, notes the CDC. The symptoms of pneumonia that are caused by fungi are often similar to those of other forms of pneumonia, including a fever, dry cough, shortness of breath, and fatigue. But because this type of pneumonia usually affects people with weakened immune systems, symptoms tend to develop faster, and people often experience a high fever. Your doctor can monitor your lungs while you inhale, listening for crackling sounds that are audible only with a stethoscope. In order to confirm the diagnosis and identify the specific germ causing the illness, you may get a chest X-ray as well as a sputum test or nasopharyngeal swab, depending on your medical history and physical exam, if your doctor suspects that you have pneumonia. Urine samples may also be collected for diagnostic purposes, as in the case of Legionnaire’s disease, per the National Library of Medicine. If you have trouble breathing, don’t wait for an office visit with your doctor; go to the emergency room right away. If left untreated, pneumonia can become severe. People with severe pneumonia experience higher fevers along with GI symptoms, such as vomiting and diarrhea, as well as:

Difficulty breathingExcessive sweatingRapid breathingRapid heart rateBluish tint to lips and nails from a lack of oxygen in the blood

Additional potential complications include bacteria in the bloodstream (bacteremia): the bacteria causing pneumonia in your lungs can enter your bloodstream and spread the infection to other parts of your body. A bacterial infection of the lungs from pneumonia can also lead to a pus-filled cavity in the lung, called a lung abscess. Both of these complications are treated with antibiotics, notes the Cleveland Clinic. Older people may also become confused or less aware of what’s going on around them if they develop pneumonia. Rather than a fever, their temperatures might be lower than normal, and they may have milder or fewer symptoms. Even so, a serious infection may still be brewing that requires medical attention. Additional reporting by George Vernadakis.