The U.S. Supreme Court dealt a major blow to public sector unions on Wednesday. In a 5-4 decision, the Supreme Court turned public sector employment into a “right to work” venture, ruling that non-public sector union members aren’t compelled to pay dues to the union that represents them at the bargaining table.

The Court also ruled that union fees must be opt-in for employees and not opt-out, which makes it harder for unions to collect fees. Non-union members already can opt out of fees used to finance political organizing, but now they can opt out of fees used to pay for the cost of collective bargaining and representing workers.

“This procedure violates the First Amendment and cannot continue,” read the majority decision written by Justice Samuel Alito. “Neither an agency fee nor any other payment to the union may be deducted from a nonmember’s wages, nor may any other attempt be made to collect such a payment, unless the employee affirmatively consents to pay. By agreeing to pay, nonmembers are violating their First Amendment rights, and such a waiver cannot be presumed.”

The Court’s decision will affect, in particular, 22 union stronghold states such as New York, California and Illinois.

Labor leaders were quick to denounce the court’s decision.

“As millions of American workers recommit to their unions and launch new organizing drives and as support for labor unions has risen to its highest level in years, it is shameful that the billionaire CEOs and corporate special interests behind this case have succeeded in manipulating the highest court in the land to do their bidding,” said American Federation of Teachers President Randi Weingarten in a statement. “This case was nothing more than a blatant political attack to further rig our economy and democracy against everyday Americans in favor of the wealthy and powerful.”

“This decision is yet another example of how billionaires rig the system against working people, but SEIU members won’t let the extremists behind this case divide us,” added 32BJ SEIU President Héctor Figueroa in a statement. “We will stay united, help working men and women who are fighting to form unions and call on our elected leaders to do everything in their power to make it easier for working people to join together in unions.”

The Janus v. AFSCME case involved plaintiff Mark Janus pushing back against having to pay union dues for public-sector unions citing the First Amendment. Up until this week, all union-represented public sector workers had to pay dues even if they didn’t want to join the union because the union negotiates salaries and benefits for all employees. The National Right to Work Foundation and the Liberty Justice Center (the Illinois Policy Institute’s litigation wing) bankrolled the case, hoping to smash government unions.

In a statement, AFL-CIO President Richard Trumka said the Supreme Court “conceded to the dark web of corporations and wealthy donors who wish to take away the freedoms of working people.”

“Until it is overturned, this decision will be a political stain on what is intended to be the most honorable, independent body in the world,” continued Trumka. “But more importantly, it will further empower the corporate elites in their efforts to thwart the aspirations of millions of working people standing together for a better life.”

The fight with union dues dates back to the 1977’s Abood v. Detroit Board of Education case where the Supreme Court ruled that workers were allowed to opt out of full union membership but still had to pay union dues. Labor leaders argued that because all workers were paid union wages regardless of membership, even unaffiliated workers should pay contract negotiating costs.

Janus’ legal representatives felt that Abood should be overruled because it failed to apply better First Amendment scrutiny to a compulsory fee for speech to influence governmental policies. The court agreed.

Tuesday, District Council 37 reached a tentative deal with the City of New York for a new contract. Less than 24 hours later, DC 37 Executive Director Henry Garrido spoke on how important the process was and how he feels that the Supreme Court is out of touch with the American people.

“Today’s decision is appallingly out of sync with both public sentiment and the difficult times now faced by working families,” said Garrido in a statement. “As an antidote to the economic inequality that threatens the security and stability of our country, the labor movement is viewed more favorably by Americans (especially the young), than it has been in decades.”

But although the voices against the Supreme Court’s decision were loud, there were a few who celebrated the decision. Daniel DiSalvo, senior fellow at the Manhattan Institute (a conservative think tank), laid out why he felt this was a victory for free speech.

“Today’s Supreme Court decision in Janus v. AFSCME is a major victory for public workers’ rights of freedom of speech and association,” said DiSalvo in a statement. “No longer will over 5 million state and local government workers be required to pay unions if they do not want to be members. Justice Alito points out that while all workers may benefit from union representation, such benefits are not sufficient grounds for infringing on some workers’ First Amendment rights. That is a reversal of the court’s flawed reasoning in the 1977 precedent, Abood v. Detroit Board of Education.”

“The Supreme Court has freed millions of American workers from manipulation by union bosses that misrepresent their interests,” added Tim Huelskamp, Ph.D., president and CEO of The Heartland Institute (an anti-union/free market think tank). “On the heels of this decision, every state should move quickly to certify that no American worker is ever compelled to give their hard-earned money to support self-serving union bosses.”