A judge’s ruling this week in a dispute involving the state’s “rainy day” fund is good news for legislators already facing budget problems.

State District Judge Kay Bates, of the 19th Judicial District, sided with the state Monday following less than an hour of arguments. A ruling in favor of the plaintiffs, who include former state Rep. Ron Gomez, could blow a $150 million hole in the state operating budget by forcing legislators to deposit money into the rainy day fund.

Gomez’s attorney, Kyle Keegan, said he plans to appeal Bates’ ruling.

At issue is a complex legal argument involving the state’s rainy day fund, formally known as the Budget Stabilization Fund.

The fund acts as a savings account to tide the state over during difficult financial times.

The legislators who created it in 1990 overlooked a flaw in the way the fund works.

Oil and gas revenue in excess of $850 million is supposed to flow into the fund until it reaches a cap. Problems arise when oil and gas revenue is high but the state still is strapped for cash.

The state constitution calls for the cap to be met even if the state is otherwise struggling. The language puts legislators in the predicament of withdrawing money from the fund to balance the budget only to watch oil and gas revenue disappear from the state general fund into the rainy day fund to meet the cap.

Faced with that scenario two years ago, legislators decided to ignore the constitution and rely on a recently passed state law that allowed them to take money from the rainy day fund without depositing oil and gas revenue until an extremely high benchmark of revenue collections was achieved.

Their action prompted Gomez’s lawsuit.

Keegan argued Monday that the rainy day fund exists to prevent legislators from relying on oil and gas revenue to pay the state’s daily expenses.

Oil and gas revenue is notoriously volatile.

Keegan said there are supposed to be no exceptions to how much oil and gas revenue can be used regardless of whether a withdrawal is made from the rainy day fund.

He said the Legislature tried to suspend the constitution through statute.

“Exceptions cannot be made up by the Legislature,” Keegan said.

He challenged the statute as unconstitutional.

Assistant Attorney General Patricia H. Wilton said the Legislature exercised its power since the constitution does not delve into all issues involving the rainy day fund.

“Where the constitution is silent, the Legislature is free to act,” Wilton said.

She said the rainy day fund would be rendered useless under Keegan’s argument.

Wilton said the fund was created to allow the Legislature to stabilize the budget.

If money has to be repaid into the fund the same year it was withdrawn, the fund would be pointless, she said.

“This is a short-term mechanism to alleviate a budget crisis,” Wilton said.

Bates said the plaintiffs “thus far” failed to meet their burden of proof in asking for a summary judgment.

In a summary judgment, a judge can rule in favor of the plaintiffs without holding a full trial.

“Statutes are presumed to be constitutional,” Bates said.

The judge said the plaintiffs would have to show that the Legislature lacks the power to enact statutes.

Afterward, Keegan said it probably would be pointless to proceed to trial.

“Certainly the case will be appealed as soon as possible,” he said.