A state official estimates that a court ruling on retirement benefits increases for judges and other elected officials will cost taxpayers hundreds of millions of dollars.

Ruling on a case stemming from 2011 legislation, the Arizona Supreme Court said Thursday that the Legislature can't cut cost-of-living increases promised to judges and state elected officials.

The ruling involves increases paid by the Public Safety Personnel Retirement System trust.

According to The Arizona Republic, system Administrator Jim Hacking said retroactive raises for all retirees in the system will cost the trust $40 million immediately.

Hacking said the system will have to set aside an additional $335 million to pay for cost-of-living adjustments going forward.

Hacking also said the system will have to increase what it charges governments for pension benefits.