Republicans in the West Virginia legislature overrode the governor's veto of a contentious right-to-work bill on Friday, delivering another major legislative setback to organized labor.

The swift override means that a majority of U.S. states now have right-to-work laws, with West Virginia becoming the 26th. Despised by unions, these laws give workers the option to stop paying fees to unions that must still represent them.

Democrats in the statehouse, as well as Gov. Earl Ray Tomblin (D), opposed the measure. But Republicans control the state legislature and were able to override Tomblin's veto with a simple majority, voting 18-16 in the Senate and 55-43 in the House along party lines. The law will go into effect in May.

The conservative National Right to Work Committee, which has been instrumental in passing such laws around the country, said it was symbolically important that right-to-work legislation now exists in 26 states.

“While this is a good day, it is not the end of the work to be done," the group said in a statement. "We hope West Virginia’s embrace of workplace freedom will help spur other states to join the Right to Work ranks."

Nobody in the U.S. can be forced to be a member of a labor union. But where local law allows it, workers in unionized workplaces can be required to pay their union what are known as agency fees, which cover the costs of collective bargaining but not political activities. Since unions must represent all the workers in a unit -- even those who may not want representation -- unions say it's only fair that all workers contribute to the bargaining expenses. (Read The Huffington Post's full explainer on right-to-work laws here.)

But the rapid spread of right-to-work laws is giving more workers the prerogative to opt out of funding the unions that represent them. First passed in the late 1940s, such laws were long relegated to the South and West, but Republicans have recently managed to get right-to-work laws on the books even in the union-dense Midwest. West Virginia is the fourth state to pass such a law in as many years, following Indiana, Michigan and Wisconsin.

The blow to West Virginia labor unions on Friday wasn't limited to the right-to-work bill. Republicans also overrode a veto of a bill to repeal the state's prevailing wage law. Long championed by unions, prevailing wage laws require companies bidding on public projects to pay certain minimum wages to the workers they'll employ.

State Sen. Jeffrey Kessler (D), leader of the senate minority, called the pair of moves a "double-barreled attack" on West Virginia workers on a "horrific" day. Kenny Perdue, president of the West Virginia AFL-CIO union federation, thanked Tomblin for his opposition to the measures in a statement. Perdue said the federation would "remind" voters "which legislators failed them" come November.

The percentage of unionized workers in the U.S. has tumbled in recent decades, from more than 30 percent in the 1950s to just 11.1 percent last year. Union density in West Virginia is slightly higher than the national average, at 12.4 percent -- at least for now.

Also on HuffPost:

PHOTO GALLERY The Faces of the Fight for 15 Movement