Pneumonia is typically classified by where you got it and what pathogen (bacteria, virus, or fungi) caused it.
Where can you get pneumonia?
What causes pneumonia?
Bacteria
The most common type of bacterial pneumonia is called pneumococcal pneumonia. Pneumococcal pneumonia is caused by the Streptococcus pneumoniae germ that normally lives in the upper respiratory tract.
Bacterial pneumonia can occur on its own or develop after you've had a virus like the cold, flu, COVID-19 or RSV. Bacterial pneumonia often affects just one part, or lobe, of a lung. When this happens, the condition is called lobar pneumonia. Those at greatest risk for bacterial pneumonia include people recovering from surgery, people with chronic respiratory disease or viral infection, children younger than 5, older adults and people who have weakened immune systems.
Some types of bacteria cause what is known as "atypical" pneumonia, including:
- Mycoplasma pneumoniae, a tiny bacterium that most often causes infections in children ages 5-17 and young adults, especially those living and working in crowded conditions. The illness is often mild enough to go undetected and is sometimes referred to as walking pneumonia.
- Chlamydia pneumoniae, which commonly causes upper respiratory infections year-round, but can also result in a mild form of pneumonia.
- Legionella pneumophila, which causes a dangerous form of pneumonia called Legionnaire's disease. Unlike other bacterial pneumonias, Legionella is not passed from person to person. Outbreaks of the disease have been linked to exposure to contaminated water from cooling towers, whirlpool spas, and outdoor fountains.
- Haemophilus influenzae (a bacteria that causes many serious infections, the Hib vaccine helps prevent these), pertussis and psittacosis (a bacteria that infects pet birds and poultry) are additional bacterial infections that can cause pneumonia; however, they cause fewer cases of pneumonia.
Mycoplasma pneumoniae can cause “walking pneumonia”
These bacteria are referred to as "atypical" because pneumonia caused by these organisms might have slightly different symptoms, appear different on a chest X-ray, or respond to different antibiotics than the typical bacteria that cause pneumonia. Even though these infections are called "atypical," they are not uncommon.
Viruses
Infection from respiratory viruses like the influenza (flu) virus, SARS-CoV-2, the virus that causes COVID-19, respiratory syncytial virus (RSV), and human metapneumovirus (HMPV) can cause pneumonia. Additional viruses like the virus that causes chickenpox, and measles can also cause pneumonia. RSV is a common cause of viral pneumonia in young children and influenza is a common cause of viral pneumonia across all ages. Read about the connection between the flu and pneumonia. Most viral pneumonias are not serious and last a shorter time than bacterial pneumonia.
If you have viral pneumonia, you are also at risk of getting bacterial pneumonia.
Did you know? As many as 5% of children (1 out of every 20) with measles gets pneumonia and that pneumonia is the most common cause of death from measles in young children. MMR vaccination is the best protection against measles and pneumonia caused by measles.
Fungi
Fungal infections are a much less common cause of pneumonia when compared to bacteria and viruses. Fungal pneumonia is most common in people with chronic (long-term) health conditions or weakened immune systems, and in people who are exposed to large doses of certain fungi from contaminated soil or bird droppings.
Pneumocystis pneumoniais (PCP) a rare, serious fungal lung infection caused by Pneumocystis jirovecii. It occurs in people who have a weakened immune system due to a medical condition like, HIV/AIDS, or from medications that suppress their immune systems, such as those used to treat cancer or manage organ transplants.
The following are fungi that occur in the soil in some parts of the United States and can cause some people to get pneumonia.
- Coccidioides. This fungus is found in Southern California and the desert Southwest. It is the cause of Coccidioidomycosis, also called valley fever.
- Histoplasma. This fungus is found in the Ohio and Mississippi River Valleys and causes histoplasmosis.
- Cryptococcus. This fungus is found throughout the United States in bird droppings and soil contaminated with bird droppings.
- Blastomyces. This fungus is found in the midwestern, south-central and southeastern United States and causes blastomycosis.
Is Pneumonia Contagious?
Yes, some types of pneumonia are contagious, meaning it spreads from person to person. Pneumonia is mostly spread when people infected cough, sneeze or talk, sending respiratory droplets into the air. These droplets can then be inhaled by close contacts. Less often, you can get pneumonia from touching an object or surface that has the germ on it and then touching your nose or mouth. Not everyone who is exposed to pneumonia will develop it and some people are at increased risk for getting pneumonia.
There is no set time for how long you’ll be contagious once you have pneumonia. The time you may spread pneumonia to others is dependent on the type of pneumonia and what caused you to have it. Generally, if you have bacterial pneumonia, you are contagious for around 48 hours after starting antibiotics and your fever has gone away. If it is viral pneumonia, as symptoms start to go away (especially fever) so does the contagious period. Pneumonia caused by fungi are not contagious.
Reviewed and approved by the American Lung Association Scientific and Medical Editorial Review Panel.
Page last updated: March 27, 2025