U.S. regulators cleared the first generic competitor to Mylan's EpiPen, after a yearslong delay that many said contributed to the emergency allergy drug's rapid rise in price.

Teva Pharmaceuticals received Food and Drug Administration approval for generic versions of both the EpiPen and EpiPen Jr, the agency said in a statement Thursday.

The products are the first competitors cleared by the FDA that are direct generic copies of the EpiPen and could be substituted for the brand-name product by a pharmacist. Other versions of epinephrine auto-injectors, such as the Adrenaclick and Auvi-Q, are on the market, but aren't considered EpiPen generics.

Teva shares rose nearly 6 percent on the news.

"This approval means patients living with severe allergies who require constant access to life-saving epinephrine should have a lower-cost option, as well as another approved product to help protect against potential drug shortages," FDA Commissioner Scott Gottlieb said in the statement.

It may be an especially welcome time for a new entrant into the market, as the EpiPen has been facing supply issues, according to Mylan and Pfizer, which makes the EpiPen in a partnership with Mylan.

"We're applying our full resources to this important launch in the coming months and eager to being supplying the market," Teva said in a statement. The company didn't provide any details about specific timing or the planned price.

Mylan introduced its own authorized generic form of the EpiPen in late 2016, after an uproar about the branded version's price, which rose more than 400 percent over a decade. The authorized generic, identical to the original except without the brand name, cost half the price: $300 for a two-pack.

Mylan wasn't immediately available to comment on the FDA's decision.

Teva could seek to compete by pricing its generic version even lower; typically, it takes multiple generic copies of a medicine entering the market to see prices collapse substantially.

The Israeli company's application for a generic EpiPen was rejected by the FDA in early 2016, not long before the rising price of Mylan's product exploded into a major news story heading into back-to-school season, when parents often stock up for kids with allergies.

Though the key ingredient in the EpiPen, epinephrine, has been available for decades and is no longer covered by a patent, generic copies of the device have struggled to reach the market because the product is technically a drug-device combination, and the delivery device proved hard for generic competitors to copy to a degree that would satisfy regulators.

The FDA issued guidance in November 2017 to try to make it easier for generic copies of complex medicines like the EpiPen to reach the market, saying some design differences may be approved as substitutable products, as long as those differences don't affect patients' ability to use the product the way it's intended.

The FDA said Teva's generic products are expected to produce the same clinical effect and have the same safety profile as the EpiPen and EpiPen Jr. There are small differences in design, the regulator said, but they won't affect safety or efficacy.