“There is no free lunch,” Dietz said while issuing his ruling. “We either want increased standards and are willing to pay the price, or we don’t.”

The trial, which began Oct. 22, took more than 240 hours in court and 10,000 exhibits to get this far.

Sen. Rodney Ellis, D-Houston, said Dietz’s decision confirms what his party has been saying all along.

“Hopefully this latest in a long line of decisions will force the legislature to truly and systemically address the inequities in our school finance system to ensure that every child in every school—regardless of wealth—has access to a top-notch education,” Ellis said in a statement.

The state attorney general’s office declined to comment. But Texas Education Commissioner Michael Williams said he’d wait for appeal.

“The Texas Education Agency will continue to carry out its mission of serving the students and educators across our state,” he said in a statement.

Texas relies on local property taxes to fund its schools. But attorneys for the school districts said the bottom 15 percent of the state’s poorest districts tax an average of 8 cents more than the wealthiest 15 percent of districts, yet receive about $43,000 less per classroom.

Rick Gray, a lawyer representing districts mostly in poorer areas of the state, said during closing arguments that the funding system was “woefully inadequate and hopelessly broken.” He said Texas must begin producing better educated college graduates, or it would see its tax base shrink and needs for social services swell due to a workforce not properly prepared for the jobs of the future.

“Texas should be ashamed,” Gray said of the funding system.

The state countered that the system is adequately funded and that school districts don’t always spend their money wisely. “We are not here to debate whether the state is providing the best system money can buy,” argued Assistant Attorney General Shelley Dahlberg. “We are here asking if the state system is a constitutional one, and we believe that it is.”

Districts in rich and poor parts of the state are on the same side of the case, because the funding mechanism relies on a “Robin Hood” scheme where districts with high property values or abundant tax revenue from oil or natural gas resources turn over part of the money they raise to poorer districts.

But many “property wealthy” districts say that while they are in better shape than their poorer counterparts, the system still starves them of funding, because local voters who otherwise would support property tax increases to bolster funding for their schools refuse to do so, knowing that most of the money would be sent somewhere else.

Also suing were charter schools, which wanted state funding for their facilities and for Texas to ease or a remove a cap allowing only 215 licenses to operate charter schools statewide. Dietz said those complaints did not violate the state constitution.