Drug companies will be unable to game a requirement to give states large prescription rebates through Medicaid under a law the Trump administration implemented Thursday.

The guidance closes a loophole that drug companies exploited by making superficial changes to existing drugs to inflate their costs and thus pay states less than they owed. The changes allowed drug companies to treat the medicines as new drugs and change the rebate calculation.

[More: Four big questions about Trump’s plan to lower drug prices]

"This is the kind of abusive behavior from drug companies that this administration will not tolerate," said Health and Human Services Secretary Alex Azar in announcing the change at the American Legislative Exchange Council in New Orleans.

The rules around these types of drugs, known as "line extensions," were changed under legislation President Trump signed into law in February.

Drug companies are required by law to give rebates to states to cover people under Medicaid, who are low-income. They must provide the lowest price available and, in exchange, states have to cover the drugs offered. Medicaid is a program that paid for by both the federal and state governments, so both will see savings from the changes. The Congressional Budget Office estimated savings at $6.5 billion over a decade.

"We want to make the rules abundantly clear to ensure that manufacturers are not gaming the system," Seema Verma, administrator for the Centers for Medicare and Medicaid Services, said in a statement following the announcement.

The Trump administration has said that lowering the prices of drugs to consumers is one of its top priorities. The latest announcement comes on the heels of another action by the administration earlier this week allowing private plans in Medicare more power to negotiate lower prices for drugs given in a doctor's office.

This new policy is different from one commonly proposed by Democrats that would give Medicare, and not private plans, the power to directly negotiate with drugmakers to lower costs. Trump had indicated during his campaign that he would be pursuing this route, but has since backed away from this position.