It was a decision that was all but foretold with the Senate confirmation of Donald Trump’s nominee to the Supreme Court, Neil Gorsuch. On Wednesday, hours before Justice Anthony Kennedy announced his retirement ahead of November’s midterm elections, the court voted 5-4 along party lines in Janus v. AFSCME to make “right to work” the law of the land.

The ruling is nothing short of disastrous for an already beleaguered American labor movement. By barring unions from charging “agency fees” to public employees who are not full members, the high court has ensured these organizations will be underfunded and undermanned, as workers will be entitled to the same benefits of representation whether they pay their dues or not. For Senate Majority Leader Mitch McConnell and the GOP’s wealthy donors, the Janus decision is a triumph, and the culmination of a decades-long conservative lobbying effort.

More than 40 years ago, D. Louis Abood sued Detroit’s Board of Education on the grounds that he shouldn’t be forced to join or make payments to a union whose political ideals he claimed to reject. His case reached the Supreme Court, where its justices ruled unanimously in 1977 that his financial contributions did not violate his First Amendment rights. In Janus, the high court has reversed a legal precedent that has been in place for more than four decades.

“Janus is a rare Supreme Court decision (though the second in this term) that overrules a previous judgment of the Court,” writes Vox’s Dylan Matthews. “The Supremes generally abide by a principle known as stare decisis, Latin for ‘to stand by things decided.’ That means that even if justices believe a past decision is wrongly decided, they generally accept it as precedent and rule in accordance with it going forward.”

Groups like the Liberty Justice Center, which represented the plaintiff, Mark Janus, had other ideas. As the New York Times reports, the organization is backed by Illinois industrialist Richard Uihlein, who has donated millions to the campaigns of Sen. Ted Cruz, R-Tx., and Republican Govs. Scott Walker of Wisconsin and Bruce Rauner of Illinois, as well as to the right-wing Federalist Society—the same organization that guided the president in his nomination of Gorsuch. The objective? To radically reshape the American judiciary.

“It’s a mistake to look at the Janus case and earlier litigation as isolated episodes,” Alexander Hertel-Fernandez, a political scientist at Columbia University, told the Times in February. “It’s part of a multipronged, multitiered strategy.”

Their gambit is already paying dividends. While the Janus ruling pertains to public employees, it is likely to encourage the private sector to become open shop as well. Observes Jacobin’s Chris Maisano, “it seems only a matter of time … either through congressional legislation or another Supreme Court case.”

Janus could prove especially devastating to teachers’ unions, which have earned a string of victories following wildcat strikes in West Virginia, Oklahoma and Kentucky. The New York Times estimates they could shed as many as one-third of their members, and with them the kind of funding that made this year’s demonstrations possible. If they manage to preserve their membership rolls, a dubious proposition even before Janus, they’ll still lose the fees of nonmembers used to help cover the costs of collective bargaining.

“Members and money are power in politics,” Stanford political scientist Terry Moe tells the Times. “This will weaken teachers’ unions nationwide as a political force.”

Maisano contends the labor movement is faced with one of two choices: watch as its numbers continue to dwindle or embrace the kind of collective action that made the teachers’ strikes this spring so effective.

“The kinds of local leaders and unofficial rank-and-file networks that initiated these struggles and highlighted their broader political ramifications have shown themselves to be labor’s best hope,” he concludes. “As they consider the post-Janus world before them, the rising generation of young radicals should do everything they can to join and support them.”