Just last month, the Republican-dominated Legislature approved a tax increase that would have raised more than $1 billion to help narrow the budget gap — a bold rejection of Mr. Brownback’s vision. In the end, the governor vetoed the measure, and he barely survived an override attempt. The school funding ruling now adds yet another layer of fiscal trouble for Kansas and political tumult for Mr. Brownback.

“Either the governor will have to bend, or we have to get enough votes in the House and Senate to override him,” Dinah Sykes, a Republican state senator, said, noting that lawmakers will have to get to work immediately to find money in the budget to satisfy the court’s requirements. “I thought that the tax plan that we put on his desk that was vetoed, I thought that was a compromise,” Ms. Sykes said.

She added that lawmakers now had to prepare to find a legislative solution — with or without the governor. “We just have to dig in and figure out how to solve this problem,” she said.

The court did not specify how much more money was needed for the state’s schools, but finding any could prove difficult. Current budget deficits reach into the hundreds of millions.

“I think there’s a clear supermajority of legislators that want to move away from Brownback economics and the failed tax experiments,” said State Representative Jim Ward, the Democratic leader in the Kansas House. “Now the school decision expedites the importance of getting that done sooner rather than later.”