(CNN) — Missouri voters handed the state’s unions and the labor movement nationwide a win Tuesday evening, opting to reject the state’s right-to-work law.

Tuesday’s referendum in the state gave voters the chance to strike down a law the state Legislature passed last year that would prohibit employees from being forced to join a union or to otherwise pay “fair share” fees to a given workplace’s union. Rules like this are commonly referred to as “right-to-work” laws, and by prohibiting requirements for employees to join a union or pay fees to a union negotiating on their behalf, they are generally understood to weaken labor organizations in places where they are enacted.

The Missouri vote marked a major victory for unions in an era replete with bad signs for organized labor. Union membership levels have declined for decades, and the ascendance of anti-union politicians across the country has handed unions legislative defeat after legislative defeat.

President Donald Trump’s election solidified the trend on the national level, with Trump making his mark on the National Labor Relations Board and appointing a slew of pro-business judges to federal courts. And the Supreme Court, in one of the most watched cases from its recent term, overturned a ruling from the 1970s that required public employees who received the benefits of unions to pay dues for nonpolitical work of the unions — a potentially major blow to public sector unions.

The AFL-CIO and other major labor groups had set their hopes and considerable resources on the effort to overturn Missouri’s law by winning a “no” vote for Proposition A.

“The defeat of this poisonous anti-worker legislation is a victory for all workers across the country,” AFL-CIO President Richard Trumka said in a statement Tuesday night. “The message sent by every single person who worked to defeat Prop. A is clear: When we see an opportunity to use our political voice to give workers a more level playing field, we will seize it with overwhelming passion and determination.”

Aurora Bihler, a St. Louis ironworker the AFL-CIO referred to CNN, sounded confident before polls closed and accused the right-to-work proponents of trying to “bleed unions dry.”

On the pro-right-to-work side, Missourians for Freedom to Work Treasurer Greg Hoberock had told CNN earlier Tuesday that the state’s lack of a right-to-work law had led businesses not to relocate to Missouri, and he predicted a downward slide for the state if it continued to go without such a rule. He said their side had been working hard as well, but that he thought the intensity from the unions nationally was to protect their “way of life.”

“From the unions’ perspective, they view this as a battleground state,” Hoberock said.

A report in The Wall Street Journal ahead of the vote noted that unions had vastly outspent their opponents, with one union-backed group outspending two opposing groups almost five times over by the end of July.

After the state’s former GOP Gov. Eric Greitens signed the bill into law last year, unions moved to get a referendum to hold up implementation of the rule and ultimately roll back the measure.

In May, Republicans were able to move the vote to August, the day of the state’s primaries, instead of the general election. The St. Louis Post-Dispatch noted at the time of the move that Democrats in Missouri thought the change could hurt them both in their chances to defeat the measure and to maximize turnout for Democratic Sen. Claire McCaskill’s closely fought re-election fight in November, while Republicans argued a quicker resolution would provide certainty for businesses.

Amid setbacks, the labor movement has seen waves of energy in several states, with teachers in West VirginiaArizona and elsewhere staging walkouts to call for improved pay and funding for education.

The-CNN-Wire™ & © 2018 Cable News Network, Inc., a Time Warner Company. All rights reserved.