WASHINGTON — States around the country are clamping down on pharmaceutical companies, forcing them to disclose and justify price increases, but the drug manufacturers are fighting back, challenging the state laws as a violation of their constitutional rights.

Even more states are, for the first time, trying to regulate middlemen who play a crucial role by managing drug benefits for employers and insurers, while taking payments from drug companies in return for giving preferential treatment to their drugs.

The bipartisan efforts by states come as President Trump and his administration put pressure on drug companies to freeze prices and reduce out-of-pocket costs for consumers struggling to pay for drugs that often cost thousands of dollars a month.

Twenty-four states have passed 37 bills this year to curb rising prescription drug costs, according to Trish Riley, the executive director of the National Academy for State Health Policy, a nonpartisan forum of policymakers, and several state legislatures are still in session.