By Carey Gillam

(Reuters) - Kansas is violating the state constitution in its funding of public schools, a duty that is mandatory and not to be left to the whims of state legislators, the Kansas Supreme Court ruled on Friday.

But while the court upheld part of a lower court finding in favor of a group of public school districts claiming the state should provide more money for education, the court also reversed part of that lower court ruling, and remanded some issues back for further analysis by a district court panel.

The lower court ruling, issued in January 2013, found Kansas was short-changing its students, and rejected as illogical a state argument that it could not afford increases for school funding at the same time that the state was cutting taxes.

Kansas Governor Sam Brownback and Republican lawmakers have argued that school funding levels should not be determined by courts but by legislators.

In the ruling issued Friday, the Kansas high court pointed to Article 6 of the state constitution, which says "the legislature shall make suitable provision for finance of the educational interests" of the state.

"The intent of the people of Kansas is unmistakable," the Kansas Supreme Court ruling states. "The Kansas constitutional command envisions something more than funding public schools by legislative fiat."

The ruling Friday comes as Brownback's re-election campaign is under attack by critics who say the sweeping tax cuts he has championed have come at the expense of schools and poor residents who have seen public assistance programs cut. Brownback and Republican legislators have been slashing taxes to try to spur job growth in the state.

The governor had only limited comments immediately following the ruling.

"This is a complex decision requiring thoughtful review," Brownback said in a statement. "I will work with leadership in the Kansas Senate and House to determine a path forward that honors our tradition of providing a quality education to every child and that keeps our schools open, our teachers teaching and our students learning."

In the ruling issued Friday, the Kansas Supreme Court distinguished between the "adequacy" of funding for schools and "equity" in such funding.

It found that the district court was wrong in how it determined whether or not Kansas was meeting its duty for adequate funding of public education and instructed the district court panel to revisit that issue. The lower court had ruled that the state must provide at least $4,492 per pupil annually for the state's roughly 600,000 students.

"Total spending is not the touchstone for adequacy in education," required by the state constitution, the court wrote in its opinion.

But on the equity issue, the court found that the district court panel correctly determined that Kansas was acting unconstitutionally, relying on "wealth-based" disparities to deny certain school districts money they were entitled to.

The state historically has made state aid payments to certain school districts but did not authorize such payments for fiscal 2010 and lawmakers have prohibited any transfers from the state's general fund for such payments through the fiscal year ending June 30, 2016.

The court has given the Kansas legislature until July 1 to fully fund its capital outlay for state aid to schools.

(Reporting by Carey Gillam; Additional reporting by Kevin Murphy in Kansas City; Editing by Jon Herskovitz and Tom Brown)

[Young student girl at school via Shutterstock]