A judge has officially blocked a small Brooklyn elementary school from closing next year, after three families from P.S. 25/the Eubie Blake School filed a lawsuit to keep it open.

The lawsuit, which was filed in March by the public interest law firm Advocates for Justice on behalf of the families, argues that the city’s decision to close the school was illegal because the local parent council did not vote on the decision.

Brooklyn Supreme Court Judge Katherine Levine did not make a final ruling on the merits of the lawsuit. Instead, she wrote that the school should remain open while the court considers the legal arguments.

“Once the school was closed it would be a fait accompli and highly improbable that the school would ever remain open regardless of the Court’s ultimate decision,” Levine wrote last month, adding the court would not have been able to weigh the evidence before school starts in September.

The education department has argued that the school is simply too small to be viable and has hemorrhaged students in recent years: P.S. 25 is on track to enroll 60 students next year in grades K-5, according to education department spokesman Doug Cohen.

“Because of extremely low enrollment, the school lacks the necessary resources to meet the needs of students,” education department spokeswoman Toya Holness previously told Chalkbeat. 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.

Typically, the city has wide authority to close schools, but 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. Advocates for the school also point out that it is among the city’s highest performing elementary schools, according to the education department’s own metrics (though 45 percent of its students are listed as chronically absent).

“We are pleased with the Court’s issuance of the [Temporary Restraining Order], keeping PS 25 open for another year while the legal issues are determined,” wrote Laura Barbieri, an attorney at Advocates for Justice. “We have confidence the correct result will be reached.”

A similar lawsuit filed in 2009, and joined by the city’s teachers union, prompted the city to reverse plans to replace three elementary schools with charter schools. (A favorable legal outcome for the P.S. 25 parents could affect the procedure for closing schools in the future, but only if they are also zoned.)

Still, no matter what happens in court, the school’s fate may still be uncertain. Even if the lawsuit forces the education department to abide by a vote from the local education council, the council’s president has said the council supports the school’s closure.

The building has also been at the center of a separate battle over space with Success Academy — though the charter network backed down from that fight Thursday.