The thyroid, which is a small gland in your neck, could throw your heart out of its natural rhythm and increase your risk for heart failure or stroke. This is because thyroid hormone has a profound effect on the heart’s function and may cause atrial fibrillation.

About 2.7 million Americans have atrial fibrillation, according to the American Heart Association (AHA). It's the most common arrhythmia, which is an irregular heartbeat that can have many different causes.

Diagnosing and treating atrial fibrillation is important because the condition can cause blood to pool in the heart and form a dangerous clot, increasing stroke risk fivefold, according to the National Stroke Association.

But to get the best treatment, you need to know the origins of this condition. Atrial fibrillation can be caused by several factors, including underlying heart disease, high blood pressure, sleep apnea, and older age, according to the AHA.

It can also stem from hyperthyroidism, which affects 1 in 100 people in the United States. With hyperthyroidism, the thyroid gland produces too much thyroid hormone.

Recognizing Atrial Fibrillation

Symptoms of atrial fibrillation include fatigue, a rapid or irregular heartbeat, dizziness, faintness, or confusion. But atrial fibrillation can be difficult to diagnose because its symptoms could apply to a wide range of other ailments, says Gordon Tomaselli, MD, a professor of medicine and chief of the division of cardiology at Johns Hopkins Medicine in Baltimore. It's also possible you may have no symptoms but still have atrial fibrillation.

A doctor visit is the best way to get an accurate diagnosis. “By listening to someone’s heart or taking their pulse, you can often tell when someone is in atrial fibrillation,” Dr. Tomaselli says. “But sometimes people’s hearts aren’t being listened to or they are not in afib when they see the doctor. And many people just don’t go to the doctor.”

How Hyperthyroidism Causes Atrial Fibrillation

If you have atrial fibrillation, a screen to check your thyroid function is in order. Once Tomaselli diagnoses a case of atrial fibrillation, he sets out to find the cause or causes of the arrhythmia. One of his first steps is to check the patient’s thyroid hormone to see if an overactive thyroid is at the root of the heart problem, even though it's not the most common cause of atrial fibrillation.

Hyperthyroidism increases heart rate and cardiac output, placing extra strain on the heart. And the most common heart condition for patients with hyperthyroidism is atrial fibrillation, according to a study published in January 2015 in The American Journal of Medicine. Excess thyroid hormone interferes with the heart’s natural electric impulses, which can throw it out of rhythm, Tomaselli explains. Other effects of hyperthyroidism include fatigue, increased appetite, and hand tremors.

Just as with atrial fibrillation, it's important to find the underlying cause for hyperthyroidism to determine the best treatment plan.

RELATED: A Surgeon Gets Back Into Rhythm After Her Atrial Fibrillation

“I think of hyperthyroidism as an umbrella diagnosis of some condition that is causing overproduction of thyroid hormone,” says Jason Wexler, MD, an assistant professor of clinical medicine at Georgetown University School of Medicine and an endocrinologist at MedStar Washington Hospital Center in Washington, DC. “Laboratory testing can determine if it is a result of lumps on the thyroid, which cause the overproduction, or Graves’ disease.”

Graves’ disease occurs when the immune system is behind the overproduction of thyroid hormone.

Hyperthyroidism and Atrial Fibrillation Treatments

“The most devastating aspect of atrial fibrillation is stroke,” Tomaselli says. That's because atrial fibrillation increases the risk for developing blood clots in the heart. Doctors often prescribe anticoagulants (blood thinners), while they try to get the heart back to its normal rhythm and reduce this atrial fibrillation risk. They might also prescribe drugs to slow down the heart and manage the symptoms of the arrhythmia, like beta-blockers and calcium channel blockers.

Depending on the severity and persistence of the hyperthyroidism, treatment options include anti-thyroid medications, radioactive iodine, and beta-blockers, Dr. Wexler says.

One of the drugs used to treat atrial fibrillation is Cordarone (amiodarone), which sets the heart back to a normal rhythm. But the use of amiodarone can negatively affect the thyroid: Its high iodine content causes many cases of hypothyroidism (too little thyroid hormone) as well as some cases of hyperthyroidism, according to Tomaselli.

“Fixing thyroid abnormalities certainly makes atrial fibrillation easier to manage,” Tomaselli says. “If you have atrial fibrillation and hyperthyroidism along with no other risk factors, then my expectation is that we’ll be able to fix your thyroid problem and fix your afib.”