CHICAGO (Reuters) - The Kentucky Supreme Court on Thursday threw out a law aimed at addressing the state’s cash-strapped retirement system because it was improperly passed by the Republican-controlled legislature.

The unanimous opinion did not address the legality of pension changes contained in the law.

Kentucky ranks among the bottom of U.S. states in terms of pension funding. It ended fiscal 2018 with an unfunded pension liability of nearly $38 billion, according to preliminary numbers included in a recent legislative update.

Republican Governor Matt Bevin, who has warned about future insolvency for pensions, called the ruling “an unprecedented power grab by activist judges.”

“This overreach by the supreme court will force our state to deal with further credit downgrades and increased borrowing costs for cities, counties, and school districts,” he said in a statement posted on his Facebook page.

The state’s high court said the pension bill was not read as required on three different days in each legislative chamber before its passage, rendering the law “constitutionally invalid and declared void.”

Toward the end of their 2018 legislative session, lawmakers removed language from a bill related to wastewater and inserted pension provisions that included putting future teachers into a less-generous retirement plan.

The bill was passed over the objections of Democratic lawmakers and was signed into law by Bevin in April.

Democratic Kentucky Attorney General Andy Beshear sued, claiming the measure violated state statutes and constitutional provisions related to public employee contracts and legislative procedures.

Oral arguments before the supreme court in September focused on legislative procedure.

On Thursday, Beshear said the court’s ruling was “a landmark win.”

“An 11-page sewer bill can never again become a 291-page pension bill and pass in just six hours without legislators even having the opportunity to read it,” he told reporters.

“From this day forward, the legislature has to act in the light of the day,” he added.

Beshear, a candidate in next year’s election for governor, has proposed expanded gaming through casinos and sports betting to boost pension funding.