Brian E. Frosh, Maryland attorney general. (Andrew Harrer/Bloomberg News)

A generic-drug trade group is suing Maryland over a price-gouging law that is set to go into effect in October.

In a federal lawsuit filed Thursday against state Attorney General Brian E. Frosh (D) and Dennis Schrader, the secretary of the state Department of Health, the Association for Accessible Medicines asked the U.S. District Court of Maryland in Greenbelt for an injunction to block the law, which it argues is unconstitutional.

“It will harm patients and our communities by reducing choice and limiting access to essential medicines that people need,” Chip Davis, chief executive officer of the association, said in a statement.

Maryland is the first state to give its attorney general the power to take legal action against drug companies that dramatically increase the price of off-patent or generic drugs.

Frosh proposed the legislation, which received bipartisan support and passed the General Assembly with a veto-proof majority. Gov. Larry Hogan (R), who had reservations about the bill, let the measure move forward in May without his signature.

A spokeswoman for Frosh said the attorney general’s office received a copy of the lawsuit Thursday afternoon and was reviewing it

Vincent DeMarco, president of Maryland Citizens’ Health Initiative, a health-care advocacy group, said he is confident Frosh will successfully defend the “lifesaving law.”

“It is shameful that the drug corporations are wasting their time and resources fighting to keep the ability to price-gouge Marylanders,” he said. “They should be spending their time trying to make their drugs more affordable.”

In the lawsuit, the association claims the new law violates the Commerce Clause of the U.S. Constitution. It argues that the measure is “overreaching” and wrongly gives the state power to regulate interstate commerce and business in other states. The suit also claims that the law is vague and violates the companies’ right to due process.

“The Maryland General Assembly has given the Attorney General extreme, arbitrary enforcement powers and would allow him to substitute his judgment for that of the free market,” the trade group said. “Companies would be forced to read the mind of the Attorney General to determine if he thought their negotiated prices were ‘excessive.’ ”

In a letter to House Speaker Michael E. Busch (D-Anne Arundel) in May, Hogan said the legislation had a “laudable goal to combat price-gouging of consumers for life-saving drugs,” but he said he wasn’t convinced that the legislation was a solution.

Hogan raised constitutional questions similar to those included in the lawsuit, and he predicted that the law would face a legal challenge.

DeMarco said Thursday that Hogan’s letter “gave ammunition to the drug companies.”