As many as 1 million Americans who may suffer with cluster headaches may finally get some relief with the approval of the first drug specifically designed to treat the rare but devastating condition that affects mostly younger men.

Patients often have to take medications that have significant side effects such as swelling of the legs. But on Tuesday, the Food and Drug Administration approved a new treatment, Emgality, made by Eli Lilly.

In a recent clinical trial, the drug was shown to significantly reduce the number of cluster headache attacks — from an average of eight headaches per week to five per week — with few side effects.

“Emgality provides patients with the first FDA-approved drug that reduces the frequency of attacks of episodic cluster headache, an extremely painful and often debilitating condition,” Dr. Eric Bastings, deputy director of the division of neurology products in the FDA’s Center for Drug Evaluation and Research, said in a press release.

Emgality belongs to a new class of drugs called CGRP inhibitors that are used to prevent migraines or reduce their frequency. It's one of three drugs in this drug class for migraines that have been released in the past year.

“The study wasn't very long, it was only for eight weeks, but these drugs are interesting and have a lot of potential,” Dr. Alan Shepard, neurologist and headache specialist at Northwestern Memorial Hospital. “Its something we will be trying more in the future.”

“The drugs seem to be safe and effective and most neurologists will probably start using these for different types of headaches,” he added.

According to the American Migraine Foundation, cluster headaches most often occur between the ages of 20 and 40, and they may affect as many as 1 million people in the United States. However, no exact number has been determined by researchers.

Like migraines, they cause intense pain and an inability to function much at all when they strike. Unlike migraines, which tend to be more prevalent in women, the condition is more likely to affect men.

Most patients have a form called episodic cluster headaches, which come and go, in periods or cycles, the American Migraine Foundation says. Sufferers can go months without an attack and then have several sudden headaches — each one lasting anywhere from 15 minutes to three hours. The headaches are especially debilitating because they can occur from once every other day to eight times per day and last from weeks to months. They commonly occur overnight, waking people up from sleep.

The condition often goes undiagnosed because it is associated with symptoms common to other conditions, such as bloodshot eyes, excessive tearing, drooping eyelids and nasal congestion.

The medications currently used to treat cluster headaches include drugs used to treat heart and psychiatric issues. Often these drugs are prescribed in high doses and cause side effects, such as leg swelling, said Dr. Dario Zagar, president of the Associated Neurologists of Southern Connecticut.

The drug will cost roughly $7,000 per year, although that may vary depending on how often it's needed. The self-injection is given at the onset of an attack and then once a month as needed, during a cluster attack period.

Zagar called that “a welcome sight especially for young patients who are on the current medications we use, which potentially have quite a number of side effects.”

CORRECTION: (June 6, 2019, 4:30 p.m. ET) A previous version of this article misstated the length of the Emgality study in a quotation from Dr. Alan Shepard, neurologist and headache specialist at Northwestern Memorial Hospital. It was eight weeks, not three.

The article also now clarifies how often the new drug Emgality is administered. It is given at the start of an attack and then once a month as needed, not once monthly.

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK