The Supreme Court just dealt unions and workers a devastating blow.

The case, Janus v. AFSCME, dealt with the fees that public unions can collect from non-members. In a 5-4 decision, the justices ruled that people who aren’t union members but are represented by a public union cannot be forced to pay fees because fees violate their freedom of speech. Instead, union dues must be opt-in only.

In the past, when workers decided to be represented by a union, they paid union dues if they joined the union, or “fair share” or “agency” fees if they decided not to join, to support their union’s collective bargaining activities. But not all workers want to join, and by federal law, they can’t be forced to. But those workers were still covered under the union’s collective bargaining agreement, meaning they reaped the benefits of the union’s efforts to negotiate wages and other working conditions.

Now, unions won't be able to collect those fees. And getting rid of them essentially defunds unions and can keep workers from being able to collectively bargain.

“Compelling individuals to mouth support for views they find objectionable violates that cardinal constitutional command, and in most contexts, any such effort would be universally condemned,” Justice Samuel Alito wrote in the majority opinion.

As one of several decisions split by a single vote from the Supreme Court this term, the case confirms how much Neil Gorsuch’s nomination has transformed the court. Notably, the justices voted-5-4 Tuesday to let President Donald Trump’s controversial travel ban stand by just one vote. By preventing President Obama from nominating his replacement to the court, conservatives stacked the bench in their favor, and the decisions this term could motivate a Democratic backlash.

In her scathing dissent in the case, Justice Elena Kagan said the decision “will have large-scale consequences.”

“Public employee unions will lose a secure source of financial support. State and local governments that thought fair-share provisions furthered their interests will need to find new ways of managing their workforces,” she wrote.

Being represented by a union does have tangible benefits. According to the Bureau of Labor Statistics, the median weekly salary for union members in 2017 was 25.6 percent more than their non-union counterparts. And 94 percent of union members are able to buy employer-sponsored health insurance, while only 67 percent of non-union members have access.

“Unions are going to have to do more, obviously, with fewer resources when they're not able to charge a fee for the services that they are legally required to provide workers,” Celine McNicholas, the director of labor law and policy at the nonprofit Economic Policy Institute, told VICE News.

The case started in February 2015, when Republican Illinois Gov. Bruce Rauner issued an executive order that required state agencies to stop enforcing fair share fees. He then filed a lawsuit in district court that said the fees are unconstitutional because he considered them to be political in nature.

The Supreme Court had already decided in the 1977 case Abood v. Detroit Board of Education that fair share fees are constitutional — as long as they go toward collective bargaining and not political advocacy. Rauner’s case was eventually allowed to go forward with another plaintiff and traveled all the way to the Supreme Court.

While writing for the majority on Wednesday, however, Alito overturned the Abood decision, which he called “poorly reasoned."

"Fundamental speech rights are at stake," he wrote.