CHICAGO (CBS/AP) — In a ruling that could financially cripple labor unions representing government workers, The Supreme Court has overturned a 40-year-old ruling that allows public sector unions to collect fees from non-members to cover the costs of negotiating contracts for all employees.

The 5-4 ruling in Janus vs. AFSCME is a win for Gov. Bruce Rauner, who has fought to weaken labor unions, and originally filed the case after he was elected to office. He was later dropped from the case, but has continued to be a vocal supporter.

Illinois state worker Mark Janus was the lead plaintiff in the case. He refused to join AFSCME, but was still required to pay “fair share” fees, because his salary and benefits were negotiated by the union. Janus objected to paying those fees of approximately $50 per month, because he opposed the union’s support of democrats.

“They made certain comments, and they made certain platform decisions that I just couldn’t abide with,” Janus said outside the Supreme Court building on Wednesday. “I just totally disagreed with them.”

The court essentially agreed with Janus’s argument, saying forcing him and other workers who decline to join state employee unions violates their right to free speech.

The ruling could deal a major financial blow to public employee unions, which make big money political donations, largely to democrats. In short, the ruling represents a serious body blow to democrats in Illinois and other states, who have come to depend on big money and manpower from labor unions at election time.

Rauner had been in Washington the past three days, in anticipation of the Janus case ruling.

Rauner has said the Janus ruling would help bring significant change in Springfield, touting the case as a major achievement as he seeks a second term.

“It is an historic victory for freedom of speech and freedom of affiliation for public sector employees. It is also an historic victory for taxpayers, who for too long have borne the unfair excessive costs inherent in the conflict of interests between government union leaders and politicians,” Rauner said.

AFSCME officials said the ruling would not stop union members from standing together for fair pay and benefits for all working people.

“This case is a blatant political attack by Bruce Rauner and other wealthy interests on the freedom of working people to form strong unions,” AFSCME Council 31 Executive Director Roberta Lynch said. “We are extremely disappointed the Supreme Court has taken the side of the powerful few, but we’re more determined than ever to keep our union strong, standing up for public services and the working people who provide them.”

The Chicago Teachers Union called the ruling a blow to public services.

“Let’s be very clear: the right wing is interested in attacking public services, public education, and public accommodations in general,” CTU Vice President Jesse Sharkey said.

The Illinois Federation of Teachers and the Illinois Education Association, the state’s largest teachers unions, both called the Supreme Court ruling disappointing.

“This case was a direct attack on working people and the causes we fight for every day – protections like health care, safe workplaces, and small class sizes,” IFT President Dan Montgomery stated.

Montgomery called the case personal for all teachers and school staffers.

“Rauner and his powerful friends are focused on eliminating unions because we are one of the last checks on their control and their attempts to rig the economy and democracy further against working people,” he stated. “And so no court case will divide us or stop our movement. We value our voice. We value our union. And we will keep fighting powerfully for the future we all deserve.”

The justices deadlocked 4-4 in a similar case last year, and the high court decided to take on the Illinois case after Justice Neil Gorsuch’s appointment.

With its decision, the court overturned a 40-year-old Supreme Court ruling that allows public sector unions to collect fees from non-members to cover the costs of negotiating contracts for all employees.

About half the states have similar laws covering so-called “fair share” fees that cover bargaining costs for non-members.

Janus sought to overturn a 1977 Supreme Court case, Abood v. Detroit Board of Education. It said public workers who refuse to join a union can still be required to pay for bargaining costs, as long as the fees don’t go toward political purposes. The arrangement was supposed to prevent non-members from “free riding,” since the union has a legal duty to represent all workers.

A federal appeals court in Chicago rejected Janus’ claim in March.

About half of all union members now work for federal, state and local governments, and many are in states like Illinois, New York, and California that are largely democratic and seen as friendly toward unions.

Rauner’s democratic challenger in the Illinois gubernatorial race, J.B. Pritzker, weighed in on the Supreme Court’s decision Wednesday.

“From the very beginning, Bruce Rauner has attempted to weaken collective bargaining rights for labor unions in illinois–for working families, working people.” Pritzker said.

The State of Illinois, as a result to the Supreme Court decision, immediately sent a letter to unionized employees notifying them non-unionized employees would no longer be charged fair-share fees. The change is being put into effect immediately.

AFSCME represents about 75,000 state workers and says the change will affect about 7,500 of those employees.