TOPEKA, Kan. — A district court panel in Kansas declared Friday that key parts of a new state law for funding public schools violate the state constitution and ordered an immediate increase in aid.

State officials and an attorney for four school districts challenging the law said the decision from the three-judge panel in Shawnee County District Court would force the state to provide between $46 million and $54 million in extra aid next week, distributing the money under an old formula that legislators junked.

The same panel ruled in December that the state must boost its annual spending by at least $548 million to fulfill its duty under the Kansas Constitution to provide a suitable education to every child.

In its latest ruling, the panel of judges said school funding changes this year make the distribution of more than $4 billion a year less fair.

The new law scrapped a per-student formula for distributing aid to Kansas’ 286 school districts. Gov. Sam Brownback and other conservative Republicans in the Republican-dominated Legislature disliked the old formula partly because it automatically left the state on the hook for additional spending if schools gained students, if more students had special needs or even if districts had major building projects.

Attorney General Derek Schmidt notified the Kansas Supreme Court that he would appeal the decision; the high court already is reviewing the panel’s December ruling. Brownback and other Republican leaders condemned Friday’s ruling.