The Kansas Supreme Court on Wednesday unanimously struck down a state law that changed how chief district judges were selected — setting up a possible showdown over funding for the courts.

The court ruled the Legislature usurped the Supreme Court’s authority when it passed House Bill 2338 in 2014.

District Judge Larry Solomon sued in February to stop the law. Under the law, chief judges should be picked by the direct election of judges working in each district. Previously, the judges were picked by the Supreme Court. According to Solomon, who sits in the 30th Judicial District, the 2014 law violated the Kansas Constitution.

The Supreme Court sided with Solomon, who had also prevailed in the lower courts. But the pre-Christmas ruling may bring the state closer to a crisis over court funding.

Lawmakers passed legislation earlier this year — House Bill 2005 — that strikes court funding if provisions of the 2014 law are struck down, which the Supreme Court did with its Wednesday ruling. But Solomon’s attorney, Pedro Irigonegaray, said an injunction against defunding the courts will remain in place until at least mid-March.

Irigonegaray said he hopes the Legislature will take action when it returns in January.

"The best possible solution to the nightmare that has been created by the Legislature in the publication of (House Bill 2005), which was signed by the governor, is the legislative branch of our government immediately upon returning correct this situation and fully fund the judiciary," Irigonegaray said.

Attorney General Derek Schmidt also urged lawmakers to sever the link between judicial funding and the Wednesday decision. The Senate Judiciary Committee chairman, Sen. Jeff King, R-Independence, downplayed the possibility the courts will be left without funding and appeared to indicate lawmakers won’t allow defunding.

"There is no attempt to defund the judiciary at all and when we go back into session next month I will work hard to make crystal clear the Legislature is not attempting to defund the judiciary nor will it," King said.

Rep. Jim Ward, D-Wichita, expressed doubt with King’s statement, saying he is "skeptical the architect of the law that contains the non-severable clause is now championing funding for the courts."

Some lawmakers worried about the possibility of a showdown with the judiciary when the Legislature passed House Bill 2005 this past spring. But supporters of tying the judicial budget to the selection process for chief judges, such as King, denied that charge.

The lawsuit that led to the high court’s decision had been on an expedited path. The court held oral arguments earlier this month.

Solomon’s attorneys argued the legislation is unconstitutional as a violation of the separation-of-powers doctrine and asked the Supreme Court to invalidate the entire law. The state said the law was a proper exercise of longstanding legislative authority to regulate the selection of "officers" under the Kansas Constitution.

In the majority opinion, delivered by Justice Eric Rosen, the Supreme Court found the law did violate the separation of powers.

"The language of our constitution and application of caselaw factors for analyzing issues in cases involving separation of powers leads us to an ultimate opinion that is consistent with the opinions of courts in other jurisdictions: the means of assigning positions responsible to the Supreme Court and charged with effectuating Supreme Court policy must be in the hands of the Supreme Court, not the legislature," the court said.

"By enacting (the law) the legislature asserted significant control over a constitutionally established essential power of the Supreme Court."

The court’s newest member, Justice Caleb Stegall, wrote a separate, concurring opinion. While he agreed with the majority’s decision to strike down the law, he offered different reasoning.

Stegall wrote the decision of the majority "does little to restore the proper sequestering of the three great governmental powers within their respective departments." Other laws, such as creating judicial positions with additional duties and additional pay have been allowed to stand, yet they are "equally offensive" to the separation of powers, he said.

"In so doing we demonstrate that we will look askance at such mixing only when it comes at the expense of cherished departmental powers," Stegall wrote.

King indicated he agreed with Stegall's opinion and said he would support the Supreme Court’s decision to strike down the selection law if the court also struck down other laws that deal with judicial powers. House Speaker Ray Merrick, R-Stilwell, said in a statement the court had found the separation of powers compelling enough to rule in its own favor, adding that he hopes the court holds the concept in "such reverence" in future rulings.

Schmidt also offered praise for Stegall’s opinion.

"For those who think the structures of our government are themselves vital bulwarks of liberty, the reasoning of Justice Stegall’s concurring opinion offered some degree of hope that the court’s separation-of-powers jurisprudence may someday become more principled and consistent," Schmidt said.

Ryan Wright, director of Kansans for Fair Courts, in a statement called the decision a victory for the separation of powers.

"The Kansas Supreme Court continues to be the only remaining branch of the government that is protecting Kansans from the political grab that is underway by politicians in Topeka. Today was a good day for democracy and our fair and impartial courts," Wright said.

The court arrived at its decision to find the 2014 law unconstitutional without Chief Justice Lawton Nuss. Attorney General Derek Schmidt had asked all the justices to recuse themselves. Nuss was the only justice who did.

Nuss said he had more directly engaged in public communication and the legislative process than the other justices and cited testimony he had provided to the Legislature.

Senior Judge Michael Malone sat on the court in Nuss’ place.