A judge blocked the closure of a small Brooklyn elementary school Thursday — at least for now.

Three families from P.S. 25/the Eubie Blake School filed a lawsuit in March backed by the public interest group Advocates for Justice, arguing the city’s decision to close the school was illegal because the local elected parent council was not consulted.

Brooklyn Supreme Court judge Katherine Levine did not make a final ruling Thursday about whether the closure plan violated the law. But she issued a temporary order to keep the school open while the case moves forward.

It was not immediately clear when the case will be resolved or even if the school will remain open next year. “We are reviewing the stay and will determine an appropriate course of action once the judge makes a final decision on the case,” education department spokeswoman Toya Holness wrote in a statement.

The education department said the school has hemorrhaged students in recent years and is simply too small to be viable: P.S. 25 currently enrolls just 94 students in grades K-5.

“Because of extremely low enrollment, the school lacks the necessary resources to meet the needs of students,” Holness wrote. The city’s Panel for Educational Policy, a citywide oversight board that must sign off on all school closures, voted in February to close the school.

But the school’s supporters point out that despite low test scores in the past, P.S. 25 now ranks among the city’s top elementary schools, meaning that its closure would force students into lower-performing schools elsewhere.

“Why close a school that’s doing so well?” said Leonie Haimson, the executive director of Class Size Matters and one of the lawsuit’s supporters. “It doesn’t make sense to me.”

The lawsuit hinges on a state law that gives local education councils the authority to approve any changes to school zones. Since P.S. 25 is the only zoned elementary school for a swath of Bedford-Stuyvesant, the department’s plans would leave some families with no zoned elementary school dedicated to educating them, forcing students to attend other district schools or enter the admissions lottery for charter schools.

That amounts to “effectively attempting to change zoning lines” and “unlawfully usurping” the local education council’s authority to determine those zones, according to the lawsuit.

But even if the education department loses the lawsuit, the school’s fate would still be uncertain. The closure plan would theoretically be subject to a vote from the local education council, whose president supports shuttering the school.

Still, Haimson hopes the lawsuit ultimately persuades the education department to back away from closing the school in the long run.

“My goal would be to get the chancellor to change his mind,” Haimson said. “I don’t think the future is preordained.”