SANTA FE, N.M. — Spending on prescription medication by New Mexico state agencies is rising quickly as insurance coverage expands under Medicaid and demands for specialty drugs are met for everyone from prison inmates to retired state workers, a new study by the state Legislature has found.

Staff of the Legislative Finance Committee announced study results Wednesday showing that state agencies spent $680 million on prescription drugs during the most recent budget year, an increase of 54 percent from two years earlier.

The trend puts New Mexico in line with a nationwide pattern of significantly expanded spending on prescription drugs, state Program Evaluator Jenny Felmley told lawmakers gathered in Santa Fe.

Much of the spending increase can be attributed to New Mexico’s rapid expansion of Medicaid health coverage for the poor and disabled. Medicaid costs are paid for largely by the federal government. Increased state spending also was linked to brand drugs and high-priced specialty drugs for complex conditions and rare diseases.

The state’s Medicaid program, for instance, spent almost $66 million on drugs for 900 people with hepatitis C between 2014 and 2016, the report said. New patented cures for hepatitis C also are weighing on the budget at the Department of Corrections, which spend an estimated $6 million last year to treat fewer than 100 patients. The agency’s health care provider estimated last year that just over 3,100 inmates are infected with hepatitis C.

“It’s not going to get any better. It’s getting worse,” said Sen. Richard Martinez, D-Espanola, of the prescription costs at prisons.

The national debate over the costs and benefits of rising drug prices spilled over into Wednesday’s committee meeting at the state Capitol, where a representative from a major trade organization for drug manufacturers shared a presentation table with consumer advocates and an executive from Express Scripts, a major pharmacy benefit provider for the state.

Elizabeth Imholz, a special projects director at the nonprofit Consumers Union, emphasized the need for more regulated disclosures from drug manufacturers about spending on marketing versus lab research, as well as information that can help states plan future budgets.

Drug cost increases were most pronounced at the New Mexico Human Services Department that oversees Medicaid, where spending rose to $424 million for the fiscal year ending in June, up from $232 million two years earlier.

Agency Secretary Brent Earnest said that reflects the additional of about 250,000 Medicaid beneficiaries since 2014. Prescription drug utilization under Medicaid in New Mexico increased by 50 percent between fiscal years 2014 and 2016, the legislative study said.

The executive director of the New Mexico Health Care Retiree Authority, Mark Tyndall, said pharmacy costs rose about 15 percent last year to $92 million under the agency, and that cancer drugs were the biggest driver of prescription costs.

“That’s a tough one to get at,” said Tyndall, noting that the agency is likely to examine in the future how to reduce unwarranted demands for certain medications.

Sen. George Munoz, D-Gallup, suggested New Mexico should strive for the same discounts and rebates as federal agencies including the U.S. Department of Veterans Affairs. California voters are considering a ballot initiative in November that would require state agencies to pay the so-called VA price for prescription drugs, although questions remain over the measure’s feasibility.