MECKLENBURG COUNTY, N.C. (AP) — A North Carolina lawsuit that attempts to block a law permitting four Charlotte-area municipalities to operate their own charter schools can’t go forward, the state Court of Appeals ruled Tuesday.

Two years ago, the North Carolina and Charlotte-Mecklenburg NAACP chapters and two parents challenged the law approved by the General Assembly in 2018, saying it violated the state constitution in part by encouraging racial segregation and financial inequity in public schools.

Republican lawmakers and town leaders who pushed the measure said it had nothing to do with race, but rather addressed overcrowded public schools in their area that the Charlotte-Mecklenburg school system failed to address adequately.

Wake County Superior Court Judge Vince Rozier refused last year to dismiss the lawsuit — as Republican legislative leaders who were sued had sought — and referred it to a panel of trial judges, which handle claims of unconstitutionality.

But the GOP lawmakers appealed to the Court of Appeals, where a separate panel of appeals judges vacated Rozier’s ruling Tuesday.

The plaintiffs “have not alleged in their complaint they sustained a direct injury, or that they are in immediate danger of sustaining a direct injury, resulting from the (law’s) enactment,” Court of Appeals Judge Jeffery Carpenter wrote in the unanimous opinion.

The plaintiffs argued the new option for Matthews, Mint Hill, Huntersville and Cornelius would create essentially new town school districts that siphon money from the Charlotte-Mecklenburg schools.

The law caused the school system — the state’s second largest with 140,000 students — to scale back student reassignment plans designed to promote classroom integration and blunt the affects of poverty upon students, according to the lawsuit.

But this allegation demonstrates an indirect injury to the civil rights groups and parents, Carpenter wrote, rather than a direct injury that the state Supreme Court declared is needed to have legal standing to sue.

And since none of the four towns has formally applied to the State Board of Education to operate a charter school, Carpenter added, “we conclude there can be no direct injury or immediate threat of injury.” Appeals Judges Valerie Zachary and Allegra Collins joined in the opinion.

Spokespeople for House Speaker Tim Moore and Senate leader — two named defendants — didn’t respond Tuesday to a request for comment.

The Lawyers’ Committee for Civil Rights Under the Law, whose attorneys helped represent the plaintiffs, emphasized that Tuesday’s ruling focused on the legal standing to sue, rather than the challenge of the actual law.

“In short: it did not close the door to challenging (the law’s) constitutionality at a future point,” Genevieve Bonadies Torres, one of the attorneys, said in a written statement.

It’s possible the ruling could be appealed, but the ruling’s unanimous nature means the state Supreme Court isn’t obligated to hear the case.

Since the 2018 law was limited to only four communities, it wasn’t subject to Democratic Gov. Roy Cooper’s veto review. But he said that year that “municipal charter schools set a dangerous precedent that could lead to taxpayer funded resegregation.”

Racial equality in public schools is particularly scrutinized in the Charlotte-Mecklenburg system, which was the subject of a landmark 1971 U.S. Supreme Court ruling upholding busing to address segregation.

In the late 1990s, a federal judge lifted the busing order upheld by the Supreme Court. A “neighborhood” school assignment policy followed that the plaintiffs say led to “dramatic resegregation.”