The Supreme Court ruled narrowly against labor unions Monday, deciding that home-care workers in Illinois do not have to pay compulsory dues to public worker unions.

The court ruled 5-4 that home health aides do not qualify as government employees, and therefore cannot be required to pay dues to public-sector unions, USA Today reports. The decision therefore concludes that a partial public employee can opt out of joining a union, and is not required to pay dues to that group.

The opinion, penned by Justice Samuel Alito, struck down the obligatory rule, but did not overrule the court's "agency shop" precedent, which applies to all public sector workers.

The case, which was brought before the Supreme Court by eight home-care workers in Illinois, was the biggest labor case heard by the court this year. While the ruling did not strike down the law in 26 states, it diminishes some fiscal and political power of public-sector unions.

The broad union dues law allows unions to collect dues from all private and public sector workers. Those who object to the union dues do not have to contribute to the union's lobbying or political activities, but they are still forced to pay dues to help the union fight for benefits, better wages and improved working conditions.

The case, Harris v. Quinn, involved home-care workers who served people who were disabled as part of the federal-state Medicaid program. The workers argued that they should not have to pay dues to the Service Employees International Union, although the union provides them with services and is required to represent them.

The workers were represented in court by the National Right to Work Legal Defense Foundation. The Foundation argued that public unions lobby the government for issues that workers often oppose, therefore claiming that they violate workers' First Amendment rights, as the unions speak on their behalf. The court has therefore made it clear that public-sector employees cannot be forced to support the political activity of a union.

Justice Antonin Scalia was concerned that allowing public employees to opt out of paying dues would deprive unions of the money needed to carry out duties that are required by law.

According to Politico, the decision to narrowly strike down some union membership dues comes at a time when unions already have a dearth of members. According to the Bureau of Labor Statistics, 11 percent of salaried and wage workers were members of a union in 2013, down 20 percent from 1983.

Republican governors such as Tom Corbett in Pennsylvania and Rick Snyder in Michigan have been actively fighting unions, and even some Democratic governors are turning against unions. Democratic Gov. Andrew Cuomo in New York and Gov. Pat Quinn in Illinois cut pensions and demanded concessions from labor unions to promote the states' fiscal health.

    The public has also begun to turn against big labor; according to Gallup, in 2013, only 54 percent of respondents approved of unions, down from 65 percent 10 years earlier.

    Obligatory union dues help unions retain their members. When Gov. Scott Walker ended obligatory union membership in his state, the American Federation of Teachers lost 65 percent of its statewide membership. Revenue also fell 40 percent or more for other unions.

    The weakening of unions could be detrimental for the Democratic Party, as Democrats often rely on unions as their strongest allies in states like Ohio, Pennsylvania and New York.

    A large percentage of government employees also belong to unions; 35 percent of public-sector workers belong to a union, compared to less than seven percent of private-sector workers.

    John Beck, an associate professor at Michigan State University, told Politico that anti-union forces are "targeting, with this (...) ruling, the heart of organized labor and its political base."

    While the ruling against unions somewhat hinders their influence, they will still be able to keep up their membership by fighting to retain public-sector members. Police and firefighters are still members of unions in states that prohibit collective bargaining for public employees.

    While opponents of unions see the decision as a step in the right direction, unions see the ruling as allowing workers to enjoy the benefits of union-negotiated contracts without paying the costs.

    Dennis Van Roekel, president of the National Education Association, told Politico prior to the ruling that it would "undermine the ability of workers to press collectively for better public services and basic rights at work."

    "Instead of using the courts to strip away the rights of everyday heroes like teachers, nurses, caregivers, firefighters and cops," he added, "we need to focus on finding ways to create jobs, help working people and get our economy moving again."