State lawmakers have been searching for ways to curb major price increases on medicines in recent years, but Maryland, the only state that has passed a law aimed at such "price gouging" practices, already is facing legal barriers.

The law, formally known as the "Prohibition Against Price Gouging for Essential Off-Patent or Generic Drugs," gives the state attorney general authority to challenge drug companies when they have significantly raised the prices of a generic drug to an "unconscionable" level or one that is "excessive" and "not justified." The law passed in April and is set to go into effect Oct 1.

Advocates say they hope the law can reduce healthcare costs and health insurance premiums. Opponents, including generic drugmakers, counter that the law's language is not only too vague but is likely in violation of the U.S. Constitution. They note that prescription drug prices are not set by states, and that the power to regulate interstate commerce belongs to the federal government.

Armed with those arguments, the Association for Accessible Medicines, which represents generics, filed a lawsuit against the attorney general and the state health secretary.

"Manufacturers do not sell their products or make pricing decisions on a state-by-state basis," according to the complaint.

The complaint also said the language of the law was vague and doesn't hold up against the 14th Amendment's requirement for due process.

Jeffrey Francer, general counsel and senior vice president for the Association for Accessible Medicines, says he hopes a judge will reach a decision before the law takes effect.

"We feel there has to be a very bright line between what's appropriate and what's not," Francer said. "There should be clear guidance to companies about pricing and you shouldn't have to guess what's legal and not legal."

Though support for the bill was largely bipartisan, it did not come without controversy. Republican Gov. Larry Hogan, allowed the law to pass without his signature. He called the goal of the bill "laudable," but in a letter to House Speaker Michael Busch raised legal and constitutional concerns.

"I am not convinced that this legislation is truly a solution to ensuring Marylanders have access to essential prescription drugs, and may even have the unintended consequence of harming citizens by restricting their access to these drugs," he wrote.

The bill was backed by Democratic Attorney General Brian Frosh.

"When a drug company doubles or triples, or multiplies by 50, the price of medication, it imperils the health and finances of patients and their families, and it threatens public health," Christine Tobar, spokeswoman from the Maryland attorney general's office, wrote in an email. "The new law gives Maryland a necessary tool to combat unjustified and extreme price increases for medicines that have long been on the market and that are essential to our health and well-being."

The law gives the attorney general broad authority. First, after finding out about the price increases from the state's Medicaid office, he could request a justification. Then, he could take a company to court and a judge could issue several actions, including an order restraining the price gouging or fining a company up to $10,000 for each violation. The attorney general also can require a drugmaker to make the medicine available at its former price for people who are covered under Medicaid or another state program.

The bill applies only to generic drugs, which are generally less expensive than new, brand-name drugs because they can be made by multiple manufacturers, increasing competition. The law is intended to target companies that raise prices on generics.

Such price increases have gained widespread attention from federal officials as well as the states. Mylan raised the list price of its lifesaving EpiPen pack from about $100 in 2007 to $608 by 2016. Turing Pharmaceuticals bought Daraprim, a 60-year-old treatment for patients with HIV that is not a generic, and in 2015 planned to raise its price from $13.50 a tablet to $750 a tablet. Across the country, cities are struggling to afford naloxone, which reverses the effects of an opioid overdose, particularly when it comes as an auto-injector, a medical device that is patented and makes the drug more expensive.

But the generics industry believes it has been unfairly targeted, noting that some of the stories apply to drugs that do not have other manufacturers or a generic counterpart, and they say that the law protects high-priced brand name drugs.

How the lawsuit plays out will affect the way other states approach the issue. Discussions were held about a similar bill in the Oregon legislature, but the text never materialized. Massachusetts and Missouri are considering bills that would allow the state attorney general to ask drug companies to justify price increases. Other states such as New York and Rhode Island have introduced bills that would give some type of authority to the state attorney general.

The Maryland Citizens' Health Initiative, which lobbied for the Maryland drug pricing legislation, says it is confident that the law would prevail.

"It is shameful that the drug corporations are wasting their time and resources fighting to keep the ability to price gouge Marylanders," said Vincent DeMarco, president of the Maryland Citizens' Health Initiative. "They should be spending their time trying to make their drugs more affordable."