A Wisconsin judge on Friday struck down nearly all of the state law championed by Gov. Scott Walker that effectively ended collective bargaining rights for most public workers.

Walker’s administration immediately vowed to appeal, while unions, which have vigorously fought the law, declared victory. But what the ruling meant for existing public contracts was murky: Unions claimed the ruling meant they could negotiate again, but Walker could seek to keep the law in effect while the legal drama plays out.

The law, a crowning achievement for Walker that made him a national conservative star, took away nearly all collective bargaining rights from most workers and has been in effect for more than a year.

Dane County Circuit Judge Juan Colas ruled that the law violates both the state and U.S. Constitution and is null and void.

In his 27-page ruling, the judge said sections of the law “single out and encumber the rights of those employees who choose union membership and representation solely because of that association and therefore infringe upon the rights of free speech and association guaranteed by both the Wisconsin and United States Constitutions.”

Colas also said the law violates the equal protection clause by creating separate classes of workers who are treated differently and unequally.

The ruling applies to all local public workers affected by the law, including teachers and city and county government employees, but not those who work for the state. They were not a party to the lawsuit, which was brought by a Madison teachers union and a Milwaukee public workers union.

Walker issued a statement accusing the judge of being a “liberal activist” who “wants to go backwards and take away the lawmaking responsibilities of the legislature and the governor. We are confident that the state will ultimately prevail in the appeals process.”

Wisconsin Department of Justice spokeswoman Dana Brueck said DOJ believes the law is constitutional.

The ruling throws into question changes that have been made in pay, benefits and other work rules in place across the state for city, county and school district workers.

Walker’s law, passed in March 2011, only allowed for collective bargaining on wage increases no greater than the rate of inflation. All other issues, including workplace safety, vacation, health benefits, could no longer be bargained for.

The ruling means that local government and schools now must once again bargain over those issues, said Lester Pines, an attorney for Madison Teachers Inc. that brought the case.

“We’re back to where we were before the law was enacted,” he said.

Pines predicted the case would ultimately be resolved by the state Supreme Court.