Democratic lawmakers on Wednesday panned the Supreme Court’s ruling Wednesday that dealt a devastating blow to public sector unions, as Republicans cheered the decision as a victory for free speech.

In the case Janus v. American Federation of State, County and Municipal Employees, the Supreme Court ruled 5-4 that public sector unions cannot force government works to join or financially support them.

Sen. Kamala Harris, D-Calif., argued that if a union represents all employees in negotiating a collective bargaining agreement, then all employees should share the costs of the union.

“It is up to all of us to fight to protect the ability of working families to make a living wage and pursue the American dream now more than ever,” she said.

Sen. Patty Murray, D-Wash., called the decision a “loss for working people and yet another win for corporate special interests.”

Rep. Tim Ryan, D-Ohio, expects the ruling will “eviscerate” union memberships as workers, who previously had no choice but to be involved, start pulling out of unions.

“Labor unions built this country. We have unions to thank for safe, clean work environments, the 40-hour work week, and the strongest middle class the world has ever seen. We need to be supporting and growing unions to fight for a prosperous life for all, not undercutting them,” Ryan said in a statement.

Sen. Bernie Sanders, an independent from Vermont who caucuses with the Democrats, called the decision "a direct assault on working families all over America."

Republican lawmakers celebrated the decision, calling it a victory for workers’ free speech rights.

Reps. Virginia Foxx, R-N.C., and Tim Walberg, R-Mich., declared in a joint statement that public sector employees will no longer be required to support an organization that they disagree with politically to remain employed.

“Today’s decision is a win for teachers, police officers, firefighters and public servants, who shouldn’t be forced to join a political organization or government union. Workers should be trusted to make that decision for themselves, and the Supreme Court affirmed today their First Amendment right to do just that,” Rep. Cathy McMorris Rodgers, R-Wash., said.

Public sector unions make up about half of the United States’ 14 million union members.