Commonwealth Court handed the Philadelphia Federation of Teachers a victory Thursday, ruling that the Philadelphia School District was wrong to rehire school counselors without regard to seniority after a layoff.

Facing an unprecedented financial crisis, the school system gave pink slips to all 283 counselors in 2013. It later recalled some,  but did so without regard to years of experience, flouting the union contract.

The school system said it had the right to do so because of special powers given by the law that allowed the state to take over the district.

A three-judge  panel, in a decision handed down Thursday, upheld the decision of an arbitrator ordering the district to rehire all the laid-off counselors and award them back pay.

"All prior recalls were made according to seniority. … The 2013 recalls should have proceeded under the same scheme," the judges wrote. "We are compelled to point out the obvious – that the parties bargained for binding arbitration. The benefits of binding arbitration would be eroded if the courts assumed a greater role in reviewing arbitration awards."

About a dozen counselors had not been rehired when a Common Pleas Court judge handed the PFT a victory in the case in 2016. Since then, all but one have been given jobs in Philadelphia schools, or were offered positions and declined them. The final counselor has accepted a job beginning at the end of August.

Jerry Jordan, PFT president, said he was delighted by the ruling.

"It's a great decision — great for all of the kids in Philadelphia," Jordan said. "It means that the children of Philadelphia will have the requirement of having at least one counselor in every school."

When the district laid off counselors, it flouted the provision in the contract that each school must have at least one full-time counselor. Every school now has a full-time counselor again, but the district had maintained that it did not have to adhere to that requirement because of its financial crisis.

It is not clear whether the district will appeal the ruling to the Pennsylvania Supreme Court.

Kevin Geary, a spokesman for the school system, said officials "are reviewing the ruling and weighing our options moving forward."