AUSTIN, Texas (Reuters) - The Texas Supreme Court ruled on Friday that the state’s financing of schools is constitutional but said the decades-long legal battle over how it pays for the education of more than 5 million children shows the system suffers serious shortcomings.

The all-Republican Supreme Court reversed a lower court decision that held the system, approved by the Republican-dominated legislature, was unconstitutional because it does not adequately or fairly provide money to public schools.

“For the seventh time since the late-1980s, we are called upon to assess the constitutionality of the Texas school finance system, a recondite scheme for which the word ‘Byzantine’ seems

generous,” the Supreme Court said in its decision.

It said the system meets minimum constitutional requirements, while adding that Texas children “deserve transformational, top-to-bottom reforms that amount to more than Band-Aid on top of Band-Aid.”

In 2014, state District Judge John Dietz, a Democrat, ruled the legislature had violated the state’s constitution when in 2011 it approved $5.4 billion in cuts to education funding, at a time schools were facing new testing requirements.

The result was widespread teacher layoffs and larger class sizes as schools struggled to meet higher state and federal standards and school enrollment soared, said attorneys for the more than 600 districts, both rich and poor and representing about two-thirds of all districts, that sued the state.

Lawmakers in the state, which has a $1.6 trillion yearly economy, responded by adding $3.7 billion in funding.

Texas Governor Greg Abbott, a Republican, called the decision a victory for Texas taxpayers.

“The Supreme Court’s decision ends years of wasteful litigation by correctly recognizing that courts do not have the authority to micromanage the State’s school finance system,” he said.

The Texas State Teachers Association, which fought against the cuts, said the decision was shallow and undermines students.

“Parents and teachers know that educating our children is not about ‘minimum constitutional requirements.’ It’s about right and wrong,” the group’s president, Noel Candelaria, said in a statement.