A Wisconsin judge has sided with the Machinists Union in a case challenging the state’s private sector “right-to-work” law. IAM Local 1061 in Milwaukee, the Wisconsin AFL-CIO and United Steelworkers District 2 in Menasha, WI argued the law was an unlawful seizure of property because it required private-sector unions to extend benefits to workers who don’t pay dues.

Wisconsin Gov. Scott Walker and the state’s GOP legislature pushed the law through in February 2015 amidst massive protests. Workers in right to work states have significantly lower wages and fewer benefits.

“The courts put a needed check on Scott Walker’s attacks on working families by ruling that Wisconsin’s Right to Work law is in violation of our state constitution,” said Phil Neuenfeldt, an IAM member and president of Wisconsin AFL-CIO. “Right to Work goes against the Wisconsin principles of fairness and democracy and hurts all of Wisconsin by eroding the strength of our middle class. Right to Work has always been unjust, now it’s proven unconstitutional.”

Dane County Circuit Judge William Foust cited the state constitution’s provision that “the property of no person shall be taken for public use without just compensation.” The impact of the law, Foust wrote, “over time is threatening to the unions’ very economic viability.”

Wisconsin’s Republican Attorney General promised to appeal the decision to the state’s 5-2 conservative majority Supreme Court.