Principals union president Ernest Logan and UFT president Michael Mulgrew announce their lawsuit over turnaround in May.

An arbitrator has ruled that the city’s plans to reform 24 struggling schools by shaking up their staffs violated its collective bargaining agreements with the teachers and principals unions.

The arbitrator’s decision adds a new and abrupt twist to months of uncertainty at the schools. It also guarantees that the city cannot claim more than $40 million in federal funds that the overhaul process, known as “turnaround,” was aimed at securing.

The turnaround rules require the schools to replace half of their teachers, and the city was trying to use a clause in its contract with the teachers union, known as 18-D, to make that happen. In recent weeks, “18-D committees” told hundreds and possibly thousands of teachers and staff members at the schools they could not return next year.

Under the arbitrator’s ruling, all of those staff members are now free to take their jobs back.

The decision is a shocking blow to the Bloomberg administration, which turned to turnaround in January in a bid to win the federal funds without negotiating a new evaluation system with the United Federation of Teachers.

Unhappy that teacher evaluation talks had fallen through weeks before, Bloomberg made the plans a surprise centerpiece of his “State of the City” speech and said the city would purge the schools of “ineffective teachers” with or without tougher evaluations.

To make that happen, the city had to engineer what amounted to overnight school closures. But the UFT and the Council of School Supervisors and Administrators argued that even though the city followed its school closure process, the changes were “sham closures” designed for political ends.

The two sides made their cases this month during a fast-tracked, high-stakes arbitration process during which Bloomberg himself testified – a rare occurrence in city-union disputes, UFT President Michael Mulgrew said. Today, an arbitrator, Scott Buchheit, agreed with the unions.

“This decision is focused on the narrow issue of whether or not the mayor’s ‘new’ schools are really new,” said a union statement issued moments after the decision came down. “The larger issue, however, is that the centerpiece of the DOE’s school improvement strategy — closing struggling schools — does not work.”

Bloomberg and Chancellor Dennis Walcott quickly announced plans to fight the ruling.

“Today’s decision is an injustice to our children that — if allowed to stand — will hurt thousands of students and compromise their futures,” they said in a statement. “We will appeal the decision because we will not give up on the students at these 24 schools.”

The city cannot appeal to the arbitrator but instead must go to the New York State Supreme Court. But the court sets a high standard for overturning the results of arbitration proceedings.

“This was always about an arm-wrestle between the Department of Education and City Hall on one side and the UFT on the other,” said Eric Nadelstern, a former top department official who retired last year and said he thinks the schools should be closed. “The only thing worse than the original plan was the decision at this juncture for reversing the original plan. This throws everything into chaos.”

That arm-wrestling match has been going on since last year. In July 2011, the city and the United Federation of Teachers announced an agreement to adopt new teacher evaluations in some schools that had landed on a state list of low-achieving schools. This made them eligible for the federal School Improvement Grants, which the city used to begin less aggressive overhauls processes known as “transformation” and “restart.” Schools that had begun the transformation process in 2010 appeared to be improving.

But when it came time to finalize that agreement in December, the city and UFT announced they were at an impasse, and the state cut off the funds in January. That was when Bloomberg announced the turnaround gambit. Even after the issue that had held up the teacher evaluation agreement was ostensibly resolved under pressure from Gov. Andrew Cuomo, the city pressed forward with turnaround.

Since January, the Department of Education has expended tremendous time and resources on the process — holding public hearings, writing extensive plans about what would change, replacing and training principals, and interviewing thousands of staffers who weere applying to keep their jobs. The department even announced new names for the schools.

The arbitrator’s ruling rolls all of that back.

“My initial thoughts are, take down any of the signs they printed — we are once again Long Island City High School,” said Ken Achiron, a veteran teacher and the union chapter leader there.

Teachers from the schools said they were thrilled by the decision but thought that some teachers would be hesitant to reclaim their positions.

“We’ve been through the whole horrific process already,” said one teacher from Lehman High School who was asked to return to the school and did not want to be identified. “I don’t think these same people are going to want to come back. I think there’s already been damage done. People were basically told we don’t want you, and now everyone’s confused. And does this mean we don’t have to be called Throgg’s Neck anymore?”

Some teachers say they have already made up their minds.

Nick Lung-Bugenski, a teacher from Long Island City High School who did not reapply for his job, said he would happily return to the school this fall. “I didn’t need to beg for my job back, a job I’ve done well for years,” he said. “I will say that it is a bittersweet victory because this is coming after months of psychological attacks on the teachers in our building. Now we’re in a position to start picking up the pieces.”

“There were no winners in this,” said Georgia Lignou, a teacher at Bryant High School. “Yes I will go back and I am extremely happy about the decision, [but] because I have lost my faith in the system, it was completely unexpected. I hope we can repair the damage they have already done.”

That is the task that UFT and city officials will turn to on Monday when they meet to chart a course for the schools from here, Mulgrew said.

“Our top priority is that these schools have to be up and running for September,” he said. “We hope we have a partner in that in the Department of Education.”

Mulgrew said he had already called City Hall to suggest that the city move to return the schools to the transformation and restart process by negotiating a new teacher evaluation system with the UFT.

To qualify for this pot of federal grants, an agreement would only have to apply to the 24 schools that were part of the turnaround program. But other federal and state funds are at stake if the city continues not to adopt new teacher evaluations, and today’s ruling signals that creative options for evading the evaluation requirement are dwindling.

Last week, when State Education Commissioner John King approved the city’s plans to shake up the schools, he said the federal funds would be contingent on the city being able to use the 18-D procedure to remove and replace teachers. Without that option, the chance of schools meeting the federal rules are slim. Only if schools are small and have experienced significant turnover in the last two years, or if vast numbers of teachers choose not to return to their schools, could any school see a 50 percent change in its staff.

Earlier this week, the city education official in charge of the turnarounds, Marc Sternberg, told GothamSchools that he thought King’s decision to approve the school overhaul plans would signal to the arbitrator that the plans were true closures. “This seems dispositive of the arbitration,” he said at the time.

The arbitrator’s decision is below.