In a blow to charter schools in New York, a rule that would have allowed certain schools to certify their own teachers was blocked in court Tuesday.

The judge’s ruling upends the plans of the city’s largest charter school network, Success Academy, and wipes out a legislative victory that New York’s charter sector thought it had won — though the decision will likely not be the end of the legal battle.

The regulations, approved by the State University of New York in October 2017, were designed to give charter schools more discretion over how they hired teachers. They eliminated the requirement that teachers earn master’s degrees and allowed charter schools authorized by SUNY to certify their teachers with as little as a month of classroom instruction and 40 hours of practice teaching.

Some charter networks argued their existing in-house training programs are more useful to new teachers than the training required for certification under state law.

But the rule was quickly challenged by the State Education Department and the state teachers union, which filed separate lawsuits that were joined in April. They argued that SUNY overstepped its authority and charged that the rule change would lead to children being taught by inexperienced and unqualified teachers.

The ruling was issued Tuesday by State Supreme Court Judge Debra J. Young, who wrote that the new certification programs were illegal because they fell below the minimum requirements issued by the state.

Charter networks “are free to require more of the teachers they hire but they must meet the minimum standards set” by the state, the judge wrote in her order. Young also concluded that laws requiring public comment were not followed.

“Today’s decision is a victory in our fight to ensure excellence in education at all schools,” state teachers union president Andy Pallotta said in a statement.

The Success Academy network and the Bronx Charter School for Better Learning had their plans for homegrown teacher certification programs approved in May, according to SUNY officials.

Success Academy spokeswoman Anne Michaud said the network is disappointed with the judge’s decision.

“As the top-performing public school system in the state, we are working to meet the demand for excellent schools that families in New York City are so desperate for, and we will continue to fight for what we know is our legal right: to train world class teachers and fill the teacher shortage that hampers so many disadvantaged neighborhoods,” Michaud said in a statement.

The certification policy grew out of the 2016 budget deal, when state lawmakers gave SUNY the authority to regulate the “governance, structure and operations of charter schools.”

The state’s top education officials — Commissioner MaryEllen Elia and Board of Regents Chancellor Betty Rosa — have long seemed offended by the new regulations. On a panel last year, Elia said, “I could go into a fast food restaurant and get more training than that.”

In a joint statement on Tuesday, Elia and Rosa praised the court’s decision as a “victory for all New York’s children.”

“In its strong opinion, the court rightly upheld the Board of the Regents and the Commissioner’s authority to certify teachers in New York State,” the statement reads.

On Tuesday, SUNY officials said they planned to appeal and believed that the judge’s ruling also offered a roadmap for creating new certification rules as long as they met those minimum standards.

“We are reviewing today’s decision. While we are disappointed that it did not uphold the regulation as written, it acknowledged the ability of the Charter School Institute to issue regulations,” said  SUNY spokeswoman Holly Liapis in a statement. “We will further evaluate our next steps.”

This post has been updated to include a statement from SUNY and from Success Academy.