Atrial fibrillation (or AFib) is a rapid, irregular heartbeat that can cause serious problems for the heart and blood vessels. It is a common concern for many doctors and patients, possibly because it can have such devastating effects if left untreated or under-treated. When the heart’s electrical system malfunctions, patients may experience palpitations (a sensation of irregular or pounding heartbeats), fatigue, dizziness, and shortness of breath. The following are seven common causes of Afib:

1. Congenital heart defects or heart valve issues

Congenital heart defects can cause serious problems with your heart’s electrical system. When this happens, you may have a life-threatening heart rhythm called ventricular fibrillation, which can quickly lead to death. Some congenital heart defects are more dangerous than others, but they all create unique and challenging problems that may require surgical repairs or replacement of the heart valves. In some cases, the condition begins in childhood or early infancy and is never corrected by medical technology.

2. Certain lung diseases

Lung diseases such as asthma, chronic obstructive pulmonary disease (COPD), and chronic bronchitis cause lung scarring that can lead to atrial fibrillation. Cigarette smoke and other air pollution are often associated with lung disease. The scarring that causes atrial fibrillation is irreversible and often requires supplemental oxygen.

3. Uncontrolled high blood pressure

Uncontrolled high blood pressure can put an incredible amount of stress on your heart, which can lead to atrial fibrillation. If you have uncontrolled high blood pressure, the upper chambers of your heart experience too much strain and cannot function properly. This leads to a rapid heart rate and irregular heartbeat, like atrial fibrillation. High blood pressure is one of the most common causes of atrial fibrillation, but it is easily treatable with medication and lifestyle changes.

4. Heart attack

Heart attack refers to a sudden decrease in blood supply to the heart muscle, which leads to disruption of the electrical system within the heart and serious damage from inflammation and scarring in the heart muscle tissue. Atrial fibrillation is a serious complication of a heart attack and can occur at any time after the heart muscle has been damaged.

5. Sleep apnea

This common sleep condition causes breathing to stop briefly while sleeping. It can contribute to atrial fibrillation and other serious conditions, including high blood pressure, obesity, and type 2 diabetes. Sleep apnea occurs more often as you grow older and affects an estimated 30 percent of adults 60 years or older. During sleep, your body processes air to make energy so that your muscles can work during the day. If your muscles fail to do this, you may wake up tired or nervous in the morning from this “sleep debt.

6. Viral infections

Certain viruses may increase your risk of developing atrial fibrillation, especially if you are older or have a weakened immune system. These include the herpes virus and the coxsackie virus, which are usually childhood illnesses. The role of viruses in atrial fibrillation is not fully understood, but the immune system plays an important role in regulating electrical activity in heart cells.

7. Thyroid disease

People with hyperthyroidism—an overactive thyroid—and those who take certain medications such as the blood-pressure drug Amiodarone are at higher risk of developing atrial fibrillation. Hyperthyroidism, which occurs in about one-third of the population, is marked by an abnormally high metabolism. It often occurs in people older than 60 and is more common in women.