The Supreme Court’s ruling last week that government workers can’t be forced to pay union fees for collective bargaining and other activities may hurt Democrats in the upcoming midterms - although some experts suggest it could have a galvanizing impact for union members to get out and vote.

The 5-4 decision in Janus vs. American Federation of State, County and Municipal Employees scrapped a 41-year- old decision that had allowed states to require public employees to pay "fair share" fees to unions that represent them.

“This procedure violates the First Amendment and cannot continue,” Associate Justice Samuel Alito wrote in the majority opinion. “Neither an agency fee nor any other payment to the union may be deducted from a non-member’s wages, nor may any other attempt be made to collect such a payment, unless the employee affirmatively consents to pay.”

Republicans and opponents of forced union dues applauded the ruling, with President Trump claiming it would be a “big loss for the coffers of the Democrats.”

Government unions, meanwhile, reacted with anger but also defiance. United Federation of Teachers President Michael Mulgrew said: “we will not be silenced.”

“Everything we have been able to accomplish for our members and our students has come from our ability to work together, and we will continue to fight for the rights of workers, their families and for public education,” he said.

AFL-CIO President Richard Trumka also vowed that the union would continue fighting, despite the disappointing decision.

“We have never depended on any politician or judge to decide our fate and we aren’t about to start now,” he said.

SUPREME COURT RULING IN JANUS UNION CASE SPARKS REACTIONS FROM TRUMP, OTHER LAWMAKERS

While unions are not allowed to use agency fees for political activity, the lack of money for collective bargaining may force some unions to move money designated for political activity back to collective bargaining.

This in turn could blunt unions as a fundraising and activist force for Democrats in the midterms and beyond.

“If you look at it from Republican vs. Democratic... because of some crazy phenomenon when blue collar union members tend to be more Republican but their labor union leaders tend to be more Democratic, this is catastrophic for the Democrats,” Fox News Senior Judicial Analyst Andrew Napolitano said on “America’s Newsroom” last week.

“This is a political disaster for the Democratic Party,” Taylor Dark, “author of “The Unions and the Democrats: An Enduring Alliance,” told TIME. “The reason is simple: public employees unions are large, with vast sums of money, and they have been able to use their money and staff to promote Democratic ideas, candidates, and legislation.

The Janus ruling makes that all much more difficult.”

SUPREME COURT DEALS BLOW TO UNIONS, RULES AGAINST FORCED FEES FOR GOVERNMENT WORKERS

Democrats spent $3.1 billion during the 2016 election, of which $189 million came from unions, according to an investigation in February by Politico. That funding is likely to be limited by the Janus decision.

Unions in states that pass right-to-work laws have seen drops in funding after such laws were passed. Between 2011-2016, four states adopted “right-to-work laws” in the midwest area: Indiana, Michigan, Wisconsin and West Virginia, according to Politico.

All four of those states voted for President Trump in the 2016 election.

A Washington Post analysis found that after such laws were passed in Michigan and Wisconsin, teacher union dues dropped between a third and a half. Such a tightening of funds may force unions to make fewer contributions to Democratic candidates and related campaigns.

However, others are not so sure.

John Beck, an associate professor at Michigan State University’s School of Human Resources and Labor Relations, told Fox News that Janus has the potential to galvanize unions and union voters, especially as the replacement for retiring Justice Anthony Kennedy may still be unconfirmed by November.

“It’s probably more a spur to action than a huge death knell,” he said.

He also said it may cause unions to organize better than they have been in recent years, which could in turn help the unions as a force.

“What it forces you to do is to act more like an organizing union, like a union that has to work every single day to get the people to pay their dues and be a member and be a part and stand in solidarity,” he added. “It is a wake up call in that sense.”

Democratic strategist Brad Bannon agreed, saying that unions are likely to be more aggressive in recruitment and communication.

“The sense I get talking to people I know is that Janus is going to light a fire under their butts, and they’re going to be more innovative to become part of the national dialogue - a lobbying force.”

Bannon said that Janus could provide a similar wake-up call for Democrats, and that he is advising Democratic clients to move away from relying on union donations and to follow the model of former presidential hopefuls Howard Dean and Bernie Sanders in fundraising from smaller donations rather than relying on money from unions.

“I don’t think it will have much impact on midterms, but it may have an impact on 2020 unless Democrats get going and adopt the modern way of fundraising,” he said.

Fox News' Bill Mears and Andrew O'Reilly contributed to this report.