PHOENIX — A sharply divided Arizona Supreme Court ruled Tuesday that public employees can be paid public money for work for their unions.

The court’s 3-2 decision said Phoenix’s negotiated labor agreement with a police union for paid “release time” doesn’t violate the Arizona Constitution’s Gift Clause, a provision barring public entities from making gifts or donations to benefit private individuals, associations or companies.

The majority’s opinion said Phoenix demonstrated that release time included in the city’s labor agreement with the Phoenix Law Enforcement Association both has a public purpose and provides the city sufficient benefits.

The city benefits by having improved labor relations and employment conditions for officers and the dollar costs of release time aren’t out of line proportionally with overall spending for police, the majority said.

The overall agreement, “including its release time provisions, serves a public purpose. It procures police services for the city,” Chief Justice Scott Bales wrote.

Groups that filed briefs on one side or the other in the case included labor unions for firefighters, police officers, and state, county and municipal workers and the Pacific Legal Foundation, a conservative advocacy organization.

The ruling was a “devastating loss for taxpayers” and a missed opportunity to protect public money, said the Goldwater Institute, a conservative advocacy and research group based in Phoenix that had sued over release time provided police.

PLEA President Ken Crane didn’t immediately respond to a request for comment.

A third vote against release time likely would have been provided by the Supreme Court’s newest justice, former Goldwater Institute attorney Clint Bolick.

However, Bolick worked on the case while with the Goldwater Institute and recused himself when it reached the Supreme Court.

As it commonly does when a justice is unavailable to consider a case, the Supreme Court had a Court of Appeals judge serve as a temporary justice.

Judge Joseph W. Howard, the fill-in justice, was part of the majority with Bales and Vice Chief Justice John Pelander.

A dissent by Justices Ann A. Scott Timmer and Robert Brutinel said allowing release time because it “tucked within a collective bargaining agreement” undercut the Gift Clause’s aim to prevent raiding public treasuries for the benefit of special interests.