ALBUQUERQUE (AP) – The New Mexico Supreme Court on Monday sided with a group of unions and ordered state labor officials to revamp the way they set prevailing wage and fringe-benefit rates for certain public works projects.

The court said Gov. Susana Martinez’s administration has a duty under a 2009 change in state law to set rates based on collective-bargaining agreements rather than on wage surveys and other information.

Justice Petra Jimenez Maes wrote in a 15-page opinion that the failure of the director of the state labor relations division to do that has resulted in stagnant rates for public projects for the last five years. As a result, payments to workers have been anywhere between 5 and 35 percent below what would have otherwise been required.

“The director’s delay in setting new rates and his failure to comply with the act is inexcusable,” Maes wrote.

The court gave state labor officials 30 days to set new rates.

The New Mexico Department of Workforce Solutions said the ruling will compromise the right of New Mexicans to have their money spent wisely. “This is a huge loss for New Mexico taxpayers and a victory for special interests that will grossly inflate the cost of public construction projects, including roads and schools, in New Mexico,” spokeswoman Joy Forehand said in a statement.

The New Mexico Building and Construction Trades Council, along with unions representing electricians and sheet metal workers, first raised concerns about compensation in 2011. At the time, state officials told the justices they would be able to set new rates within four to five months.

The labor department answered by implementing new regulations, and that move prompted litigation. The unions filed another petition with the Supreme Court seeking to force officials to abide by the language adopted in 2009.

Efforts to repeal the law have been unsuccessful, and union officials said Monday that more challenges are expected given the court order.

Shane Youtz, an Albuquerque attorney who represented the unions, said the order means thousands of plumbers, electricians and sheet metal workers should see wage increases in the next 30 days.

“It’s a ton of money,” Youtz said. “All told, New Mexico’s economy probably lost tens of millions of dollars as a result of the governor’s refusal to basically do what the law required her to do.”

The order doesn’t mean workers get any back pay. Going forward, however, they will likely see higher wages if working on highway construction or other public projects like some of the ones included in a $295 million measure approved by lawmakers during a recent special session.

Under the law, the labor relations director is required to set prevailing wage and benefit rates for all public-works projects costing more than $60,000 to which the state or any political subdivision is a party.